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 an OverlayPlotPanel which plots time series data from overlays. A TimeSeriesPanel looks something like the following:

_images/timeseriespanel.png

A TimeSeriesPanel plots one or more TimeSeries instances, which encapsulate time series data from an overlay. All TimeSeries classes are defined in the plotting.timeseries module; these are all sub-classes of the DataSeries class - see the PlotPanel and OverlayPlotPanel documentation for more details:

Control panels

Some FSLeyes control panels are associated with the TimeSeriesPanel:

PlotListPanel The PlotListPanel is a FSLeyes control panel for use with OverlayPlotPanel views.
TimeSeriesControlPanel The TimeSeriesControlPanel is a PlotContrlPanel which allows the user to configure a TimeSeriesPanel.

The TimeSeriesPanel defines some actions, allowing the user to show/hide these control panels:

toggleTimeSeriesToolBar Shows/hides a TimeSeriesToolBar.
toggleTimeSeriesControl Shows/hides a TimeSeriesControlPanel.

Some tools are also available, to do various things:

addMaskDataSeries Executes the AddMaskDataSeriesAction.

FEATures

The TimeSeriesPanel has some extra functionality for FEATImage overlays. For these overlays, a FEATTimeSeries instance is plotted, instead of a regular TimeSeries instance. The FEATTimeSeries class, in turn, has the ability to generate more TimeSeries instances which represent various aspects of the FEAT model fit. See the FEATTimeSeries and the TimeSeriesControlPanel classes for more details.

Melodic features

The TimeSeriesPanel also has some functionality for MelodicImage overlays - a MelodicTimeSeries instance is used to plot the component time courses for the current component (as defined by the NiftiOpts.volume property).

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.

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='139845844115072'>

If True, the component time courses are plotted for MelodicImage overlays (using a MelodicTimeSeries instance). Otherwise, MelodicImage overlays are treated as regular 4D Image overlays (a TimeSeries instance is used).

__init__(parent, overlayList, displayCtx, frame)

Create a TimeSeriesPanel.

Parameters:
destroy()

Removes some listeners, and calls the PlotPanel.destroy() method.

toggleTimeSeriesControl(floatPane=False)

Shows/hides a TimeSeriesControlPanel. See ViewPanel.togglePanel().

toggleTimeSeriesToolBar()

Shows/hides a TimeSeriesToolBar. See ViewPanel.togglePanel().

addMaskDataSeries()

Executes the AddMaskDataSeriesAction.

getActions()

Overrides ActionProvider.getActions(). Returns all of the actions that are defined on this TimeSeriesPanel.

getTools()

Returns a list of tools to be added to the FSLeyesFrame for TimeSeriesPanel views.

draw(*a)

Overrides PlotPanel.draw(). Passes some TimeSeries instances to the PlotPanel.drawDataSeries() method.

createDataSeries(overlay)

Overrides OverlayPlotPanel.createDataSeries(). Creates and returns a TimeSeries instance (or an instance of one of the TimeSeries sub-classes) for the specified overlay.

Returns a tuple containing the following:

  • A TimeSeries instance for the given overlay
  • A 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 the PlotPanel.xlabel or PlotPanel.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 cached TimeSeries instances for all MelodicImage overlays in the OverlayList.

__module__ = 'fsleyes.views.timeseriespanel'
prepareDataSeries(ts)

Overrides PlotPanel.prepareDataSeries. Given a TimeSeries instance, scales and normalises the x and y data according to the current values of the usePixdim and plotMode properties.