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)[source]¶ Bases:
fsleyes.views.plotpanel.OverlayPlotPanelThe
TimeSeriesPanelis anOverlayPlotPanelwhich plots time series data from overlays. ATimeSeriesPanellooks something like the following:
A
TimeSeriesPanelplots one or moreDataSeriesinstances, which encapsulate time series data from an overlay. All time series relatedDataSeriesclasses 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:The
PlotListPanelis a FSLeyes control panel for use withOverlayPlotPanelviews.The
TimeSeriesControlPanelis aPlotContrlPanelwhich allows the user to configure aTimeSeriesPanel.The
TimeSeriesPaneldefines someactions, allowing the user to show/hide these control panels:Shows/hides a
TimeSeriesToolBar.Shows/hides a
TimeSeriesControlPanel.Some tools are also available, to do various things:
Executes 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='281473497326640'>¶ 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='281473498355456'>¶ 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='281473497326640'>¶ If
True, the component time courses are plotted forMelodicImageoverlays (using aMelodicTimeSeriesinstance). Otherwise,MelodicImageoverlays are treated as regular 4DImageoverlays (aVoxelTimeSeriesinstance is used).
-
__init__(parent, overlayList, displayCtx, frame)[source]¶ Create a
TimeSeriesPanel.- Parameters
parent – A
wxparent object.overlayList – An
OverlayListinstance.displayCtx – A
DisplayContextinstance.frame – The
FSLeyesFrameinstance.
-
destroy()[source]¶ Removes some listeners, and calls the
PlotPanel.destroy()method.
-
toggleTimeSeriesControl(floatPane=False)[source]¶ Shows/hides a
TimeSeriesControlPanel. SeeViewPanel.togglePanel().
-
toggleTimeSeriesToolBar()[source]¶ Shows/hides a
TimeSeriesToolBar. SeeViewPanel.togglePanel().
-
getActions()[source]¶ Overrides
ActionProvider.getActions(). Returns all of theactionsthat are defined on thisTimeSeriesPanel.
-
getTools()[source]¶ Returns a list of tools to be added to the
FSLeyesFrameforTimeSeriesPanelviews.
-
draw(*a)[source]¶ Overrides
PlotPanel.draw(). Passes someDataSeriesinstances to thePlotPanel.drawDataSeries()method.
-
createDataSeries(overlay)[source]¶ 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
DataSeriesinstance for the given overlayA 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.
-
_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)[source]¶ Overrides
PlotPanel.prepareDataSeries. Given aDataSeriesinstance, scales and normalises the x and y data according to the current values of theusePixdimandplotModeproperties.
-