fsleyes.actions.addmaskdataseries

This module provides the AddMaskDataSeriesAction class, an action used by the TimeSeriesPanel.

class fsleyes.actions.addmaskdataseries.AddMaskDataSeriesAction(overlayList, displayCtx, plotPanel)[source]

Bases: fsleyes.actions.base.Action

The AddMaskDataSeriesAction class is used by the TimeSeriesPanel.

It prompts the user to select a mask image for the currently selected overlay (assumed to be a 4D time series Image), then extracts the mean time series for the non-zero voxels within the mask, and adds them as a DataSeries to the TimeSeriesPanel.

__init__(overlayList, displayCtx, plotPanel)[source]

Create an AddMaskDataSeriesAction.

Parameters
destroy()[source]

Must be called when this AddMaskDataSeriesAction is no longer in use.

__overlayListChanged(*a)

Called when the OverlayList changes. Updates the Action.enabled flag based on the currently selected overlay, and the contents of the overlay list.

__addMaskDataSeries()

Run the AddMaskDataSeriesAction. Prompt the user to select a mask, using a MaskDialog, then calculates the mean time series in that mask, then adds that time series to the TimeSeriesPanel that owns this action instance.

__module__ = 'fsleyes.actions.addmaskdataseries'
class fsleyes.actions.addmaskdataseries.MaskDialog(parent, choices, title=None, message=None, checkbox=True, checkboxMessage=None)[source]

Bases: __main__.docbuilder.run.<locals>.MockClass

A dialog which displays some options to the user:

  • A Choice widget containing a list of mask images

  • A checkbox allowing the user to select whether to calculate the weighted mean time series, weighted by the mask values, or calculate the unweighted mean.

The selections are available via the GetMask() and GetWeighted() methods

__init__(parent, choices, title=None, message=None, checkbox=True, checkboxMessage=None)[source]

Create a ChoiceDialog.

Parameters
  • parentwx parent object.

  • choices – List of strings, the choices to present to the user.

  • title – Dialog title

  • message – Message to show above choice widget.

  • checkbox – Show a checkbox

  • checkboxMessage – Message to show alongside checkbox widget.

property okButton

Returns the OK button.

property cancelButton

Returns the cancel button.

property checkbox

Returns the checkbox.

property choice

Returns the choice widget.

GetChoice()[source]

Returns the index of the currently selected choice.

GetCheckBox()[source]

Returns the index of the currently selected choice.

__onOkButton(ev)

Called when the ok button is pushed.

__onCancelButton(ev)

Called when the cancel button is pushed.

__module__ = 'fsleyes.actions.addmaskdataseries'