fsleyes.views.timeseriespanel¶
This module provides the TimeSeriesPanel, which is a FSLeyes
view for displaying time series data from Image overlays.
-
class
fsleyes.views.timeseriespanel.TimeSeriesPanel(parent, overlayList, displayCtx, frame)¶ Bases:
fsleyes.views.plotpanel.OverlayPlotPanelThe
TimeSeriesPanelis anOverlayPlotPanelwhich plots time series data from overlays. ATimeSeriesPanellooks something like the following:
A
TimeSeriesPanelplots one or moreTimeSeriesinstances, which encapsulate time series data from an overlay. AllTimeSeriesclasses are defined in theplotting.timeseriesmodule; these are all sub-classes of theDataSeriesclass - see thePlotPanelandOverlayPlotPaneldocumentation for more details:Control panels
Some FSLeyes control panels are associated with the
TimeSeriesPanel:PlotListPanelThe PlotListPanelis a FSLeyes control panel for use withOverlayPlotPanelviews.TimeSeriesControlPanelThe TimeSeriesControlPanelis aPlotContrlPanelwhich allows the user to configure aTimeSeriesPanel.The
TimeSeriesPaneldefines someactions, allowing the user to show/hide these control panels:toggleTimeSeriesToolBarShows/hides a TimeSeriesToolBar.toggleTimeSeriesControlShows/hides a TimeSeriesControlPanel.Some tools are also available, to do various things:
addMaskDataSeriesExecutes the AddMaskDataSeriesAction.FEATures
The
TimeSeriesPanelhas some extra functionality forFEATImageoverlays. For these overlays, aFEATTimeSeriesinstance is plotted, instead of a regularTimeSeriesinstance. TheFEATTimeSeriesclass, in turn, has the ability to generate moreTimeSeriesinstances which represent various aspects of the FEAT model fit. See theFEATTimeSeriesand theTimeSeriesControlPanelclasses for more details.Melodic features
The
TimeSeriesPanelalso has some functionality forMelodicImageoverlays - aMelodicTimeSeriesinstance is used to plot the component time courses for the current component (as defined by theNiftiOpts.volumeproperty).-
usePixdim= <MagicMock name='mock.Boolean()' id='139845844115072'>¶ If
True, the X axis data is scaled by the pixdim value of the selected overlay (which, for FMRI time series data is typically set to the TR time).
-
plotMode= <MagicMock name='mock.Choice()' id='139845843612560'>¶ Options to scale/offset the plotted time courses.
normalThe data is plotted with no modifications demeanThe data is demeaned (i.e. plotted with a mean of 0) normaliseThe data is normalised to lie in the range [-1, 1].percentChangeThe data is scaled to percent changed
-
plotMelodicICs= <MagicMock name='mock.Boolean()' id='139845844115072'>¶ If
True, the component time courses are plotted forMelodicImageoverlays (using aMelodicTimeSeriesinstance). Otherwise,MelodicImageoverlays are treated as regular 4DImageoverlays (aTimeSeriesinstance is used).
-
__init__(parent, overlayList, displayCtx, frame)¶ Create a
TimeSeriesPanel.Parameters: - parent – A
wxparent object. - overlayList – An
OverlayListinstance. - displayCtx – A
DisplayContextinstance. - frame – The
FSLeyesFrameinstance.
- parent – A
-
destroy()¶ Removes some listeners, and calls the
PlotPanel.destroy()method.
-
toggleTimeSeriesControl(floatPane=False)¶ Shows/hides a
TimeSeriesControlPanel. SeeViewPanel.togglePanel().
-
toggleTimeSeriesToolBar()¶ Shows/hides a
TimeSeriesToolBar. SeeViewPanel.togglePanel().
-
addMaskDataSeries()¶ Executes the
AddMaskDataSeriesAction.
-
getActions()¶ Overrides
ActionProvider.getActions(). Returns all of theactionsthat are defined on thisTimeSeriesPanel.
-
getTools()¶ Returns a list of tools to be added to the
FSLeyesFrameforTimeSeriesPanelviews.
-
draw(*a)¶ Overrides
PlotPanel.draw(). Passes someTimeSeriesinstances to thePlotPanel.drawDataSeries()method.
-
createDataSeries(overlay)¶ Overrides
OverlayPlotPanel.createDataSeries(). Creates and returns aTimeSeriesinstance (or an instance of one of theTimeSeriessub-classes) for the specified overlay.Returns a tuple containing the following:
- A
TimeSeriesinstance for the given overlay - A list of targets - objects which have properties that
influence the state of the
TimeSeriesinstance. - A list of property names, one for each target.
If the given overlay is not compatible (i.e. it has no time series data to be plotted), a tuple of
Nonevalues is returned.- A
-
_TimeSeriesPanel__generateDefaultLabels(timeSeries)¶ Called by
draw(). If thePlotPanel.xlabelorPlotPanel.ylabelproperties are unset, an attempt is made to generate default labels.
-
_TimeSeriesPanel__plotMelodicICsChanged(*a)¶ Called when the
plotMelodicICsproperty changes. Re-creates the internally cachedTimeSeriesinstances for allMelodicImageoverlays in theOverlayList.
-
__module__= 'fsleyes.views.timeseriespanel'¶
-
prepareDataSeries(ts)¶ Overrides
PlotPanel.prepareDataSeries. Given aTimeSeriesinstance, scales and normalises the x and y data according to the current values of theusePixdimandplotModeproperties.
-