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 theTimeSeriesPanel
.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 aDataSeries
to theTimeSeriesPanel
.-
__init__
(overlayList, displayCtx, plotPanel)[source]¶ Create an
AddMaskDataSeriesAction
.Parameters: - overlayList – The
OverlayList
. - displayCtx – The
DisplayContext
. - plotPanel – The
TimeSeriesPanel
.
- overlayList – The
-
_AddMaskDataSeriesAction__addMaskDataSeries
()¶ Run the
AddMaskDataSeriesAction
. Prompt the user to select a mask, using aMaskDialog
, then calculates the mean time series in that mask, then adds that time series to theTimeSeriesPanel
that owns this action instance.
-
_AddMaskDataSeriesAction__overlayListChanged
(*a)¶ Called when the
OverlayList
changes. Updates theAction.enabled
flag based on the currently selected overlay, and the contents of the overlay list.
-
__module__
= 'fsleyes.actions.addmaskdataseries'¶
-
-
class
fsleyes.actions.addmaskdataseries.
MaskDialog
(parent, choices, title=None, message=None, checkbox=True, checkboxMessage=None)[source]¶ Bases:
__main__.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()
andGetWeighted()
methods-
__init__
(parent, choices, title=None, message=None, checkbox=True, checkboxMessage=None)[source]¶ Create a
ChoiceDialog
.Parameters: - parent –
wx
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.
- parent –
-
okButton
¶ Returns the OK button.
-
cancelButton
¶ Returns the cancel button.
-
checkbox
¶ Returns the checkbox.
-
choice
¶ Returns the choice widget.
-
_MaskDialog__onCancelButton
(ev)¶ Called when the cancel button is pushed.
-
_MaskDialog__onOkButton
(ev)¶ Called when the ok button is pushed.
-
__module__
= 'fsleyes.actions.addmaskdataseries'¶
- A