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.OverlayPlotPanel
The
TimeSeriesPanel
is anOverlayPlotPanel
which plots time series data from overlays. ATimeSeriesPanel
looks something like the following:A
TimeSeriesPanel
plots one or moreDataSeries
instances, which encapsulate time series data from an overlay. All time series relatedDataSeries
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
, and can be added/removed viaViewPanel.togglePanel()
.The
PlotListPanel
is a FSLeyes control panel for use withOverlayPlotPanel
views.The
TimeSeriesControlPanel
is aPlotContrlPanel
which allows the user to configure aTimeSeriesPanel
.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='4118803744'>
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='4118567808'>
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='4118803744'>
If
True
, the component time courses are plotted forMelodicImage
overlays (using aMelodicTimeSeries
instance). Otherwise,MelodicImage
overlays are treated as regular 4DImage
overlays (aVoxelTimeSeries
instance is used).
- static defaultLayout()[source]
Returns a list of control panel types to be added for the default time series panel layout.
- static controlOrder()[source]
Returns a list of control panel names, specifying the order in which they should appear in the FSLeyes ortho panel settings menu.
- __init__(parent, overlayList, displayCtx, frame)[source]
Create a
TimeSeriesPanel
.- Parameters
parent – A
wx
parent object.overlayList – An
OverlayList
instance.displayCtx – A
DisplayContext
instance.frame – The
FSLeyesFrame
instance.
- destroy()[source]
Removes some listeners, and calls the
PlotPanel.destroy()
method.
- getActions()[source]
Overrides
ActionProvider.getActions()
. Returns all of theactions
that are defined on thisTimeSeriesPanel
.
- draw(*a)[source]
Overrides
PlotPanel.draw()
. Passes someDataSeries
instances to thePlotCanvas.drawDataSeries()
method, then callsPlotCanvas.drawArtists()
.
- createDataSeries(overlay)[source]
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
DataSeries
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.
- __annotations__ = {}
- __module__ = 'fsleyes.views.timeseriespanel'
- prepareDataSeries(ts)[source]
Overrides
PlotPanel.prepareDataSeries
. Given aDataSeries
instance, scales and normalises the x and y data according to the current values of theusePixdim
andplotMode
properties.
- __plotMelodicICsChanged(*a)
Called when the
plotMelodicICs
property changes. Re-creates the internally cachedTimeSeries
instances for allMelodicImage
overlays in theOverlayList
.
- __generateDefaultLabels(timeSeries)
Called by
draw()
. If thePlotCanvas.xlabel
orPlotCanvas.ylabel
properties are unset, an attempt is made to generate default labels.