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.OverlayPlotPanel
The
TimeSeriesPanel
is anOverlayPlotPanel
which plots time series data from overlays. ATimeSeriesPanel
looks something like the following:A
TimeSeriesPanel
plots one or moreTimeSeries
instances, which encapsulate time series data from an overlay. AllTimeSeries
classes are defined in theplotting.timeseries
module; these are all sub-classes of theDataSeries
class - see thePlotPanel
andOverlayPlotPanel
documentation for more details:Control panels
Some FSLeyes control panels are associated with the
TimeSeriesPanel
:The
PlotListPanel
is a FSLeyes control panel for use withOverlayPlotPanel
views.The
TimeSeriesControlPanel
is aPlotContrlPanel
which allows the user to configure aTimeSeriesPanel
.The
TimeSeriesPanel
defines 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
TimeSeriesPanel
has some extra functionality forFEATImage
overlays. For these overlays, aFEATTimeSeries
instance is plotted, instead of a regularTimeSeries
instance. TheFEATTimeSeries
class, in turn, has the ability to generate moreTimeSeries
instances which represent various aspects of the FEAT model fit. See theFEATTimeSeries
and theTimeSeriesControlPanel
classes for more details.Melodic features
The
TimeSeriesPanel
also has some functionality forMelodicImage
overlays - aMelodicTimeSeries
instance is used to plot the component time courses for the current component (as defined by theNiftiOpts.volume
property).-
usePixdim
= <MagicMock name='mock.Boolean()' id='140736147064976'>¶ 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='140736145814032'>¶ Options to scale/offset the plotted time courses.
normal
The data is plotted with no modifications
demean
The data is demeaned (i.e. plotted with a mean of 0)
normalise
The data is normalised to lie in the range
[-1, 1]
.percentChange
The data is scaled to percent changed
-
plotMelodicICs
= <MagicMock name='mock.Boolean()' id='140736147064976'>¶ If
True
, the component time courses are plotted forMelodicImage
overlays (using aMelodicTimeSeries
instance). Otherwise,MelodicImage
overlays are treated as regular 4DImage
overlays (aTimeSeries
instance is used).
-
__init__
(parent, overlayList, displayCtx, frame)¶ Create a
TimeSeriesPanel
.- Parameters
parent – A
wx
parent object.overlayList – An
OverlayList
instance.displayCtx – A
DisplayContext
instance.frame – The
FSLeyesFrame
instance.
-
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 theactions
that are defined on thisTimeSeriesPanel
.
-
getTools
()¶ Returns a list of tools to be added to the
FSLeyesFrame
forTimeSeriesPanel
views.
-
draw
(*a)¶ Overrides
PlotPanel.draw()
. Passes someTimeSeries
instances to thePlotPanel.drawDataSeries()
method.
-
createDataSeries
(overlay)¶ Overrides
OverlayPlotPanel.createDataSeries()
. Creates and returns aTimeSeries
instance (or an instance of one of theTimeSeries
sub-classes) for the specified overlay.Returns a tuple containing the following:
A
TimeSeries
instance for the given overlayA list of targets - objects which have properties that influence the state of the
TimeSeries
instance.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
None
values is returned.
-
_TimeSeriesPanel__generateDefaultLabels
(timeSeries)¶ Called by
draw()
. If thePlotPanel.xlabel
orPlotPanel.ylabel
properties are unset, an attempt is made to generate default labels.
-
_TimeSeriesPanel__plotMelodicICsChanged
(*a)¶ Called when the
plotMelodicICs
property changes. Re-creates the internally cachedTimeSeries
instances for allMelodicImage
overlays in theOverlayList
.
-
__module__
= 'fsleyes.views.timeseriespanel'¶
-
prepareDataSeries
(ts)¶ Overrides
PlotPanel.prepareDataSeries
. Given aTimeSeries
instance, scales and normalises the x and y data according to the current values of theusePixdim
andplotMode
properties.
-