fsleyes.plotting.timeseries¶
This module provides a number of DataSeries sub-classes which
are use by the TimeSeriesPanel. The following classes are provided:
TimeSeries |
Encapsulates time series data from an overlay. |
VoxelTimeSeries |
A TimeSeries sub-class which encapsulates data from a specific voxel of a Image overlay. |
FEATTimeSeries |
A VoxelTimeSeries class for use with FEATImage instances, containing some extra FEAT specific options. |
FEATPartialFitTimeSeries |
A VoxelTimeSeries class which represents the partial model fit of an EV or contrast from a FEAT analysis at a specific voxel. |
FEATEVTimeSeries |
A TimeSeries class which represents the time course of an EV from a FEAT analysis. |
FEATResidualTimeSeries |
A VoxelTimeSeries class which represents the time course of the residuals from a FEAT analysis at a specific voxel. |
FEATModelFitTimeSeries |
A TimeSeries class which represents the time course for a model fit from a FEAT analysis at a specific voxel. |
MelodicTimeSeries |
A TimeSeries class which encapsulates the time course for one component of a MelodicImage. |
MeshTimeSeries |
A MeshTimeSeries object encapsulates the time course for a Mesh overlay which has some time series vertex data associated with it. |
-
class
fsleyes.plotting.timeseries.TimeSeries(overlay, overlayList, displayCtx, plotPanel)¶ Bases:
fsleyes.plotting.dataseries.DataSeriesEncapsulates time series data from an overlay. The
TimeSeriesclass is the base-class for all other classes in this module - itsgetData()method implements some pre-processing routines which are required by theTimeSeriesPanel.The following methods are intended to be overridden and/or called by sub-class implementations:
makeLabelReturn a label for this TimeSeries.getDataOverrides DataSeries.getData().-
__init__(overlay, overlayList, displayCtx, plotPanel)¶ Create a
TimeSeriesinstance.Parameters: - overlay – The overlay to extract the data from.
- overlayList – The
OverlayListinstance. - displayCtx – The
DisplayContextinstance. - plotPanel – The
TimeSeriesPanelwhich owns thisTimeSeries.
-
makeLabel()¶ Return a label for this
TimeSeries.
-
getData(xdata=None, ydata=None)¶ Overrides
DataSeries.getData(). Returns the data associated with thisTimeSeriesinstance.The
xdataandydataarguments may be used by sub-classes to override the x/y data in the event that they have already performed some processing on the data. The default implementation returns whatever has been set throughDataSeries.setData().
-
__module__= 'fsleyes.plotting.timeseries'¶
-
-
class
fsleyes.plotting.timeseries.VoxelTimeSeries(overlay, overlayList, displayCtx, plotPanel)¶ Bases:
fsleyes.plotting.timeseries.TimeSeriesA
TimeSeriessub-class which encapsulates data from a specific voxel of aImageoverlay.The voxel data may be accessed through the
getData()method, where the voxel is defined by current value of theDisplayContext.locationproperty (transformed into the image voxel coordinate system).-
__init__(overlay, overlayList, displayCtx, plotPanel)¶ Create a
VoxelTimeSeriesinstance.Parameters: - overlay – The
Imageinstance to extract the data from. - overlayList – The
OverlayListinstance. - displayCtx – The
DisplayContextinstance. - plotPanel – The
TimeSeriesPanelwhich owns thisVoxelTimeSeries.
- overlay – The
-
makeLabel()¶ Returns a string representation of this
VoxelTimeSeriesinstance.
-
getData= <MagicMock name='mock.utils.idle.mutex()' id='139845839620640'>¶
-
__module__= 'fsleyes.plotting.timeseries'¶
-
-
class
fsleyes.plotting.timeseries.FEATTimeSeries(*args, **kwargs)¶ Bases:
fsleyes.plotting.timeseries.VoxelTimeSeriesA
VoxelTimeSeriesclass for use withFEATImageinstances, containing some extra FEAT specific options.The
FEATTimeSeriesclass acts as a container for severalTimeSeriesinstances, each of which represent some part of a FEAT analysis. Therefore, the data returned by a call toTimeSeries.getData()on aFEATTimeSeriesinstance should not be plotted.Instead, the
getModelTimeSeries()method should be used to retrieve a list of all theTimeSeriesinstances which are associated with theFEATTimeSeriesinstance - all of theseTimeSeriesinstances should be plotted instead.For example, if the
plotDataandplotFullModelFitsettings areTrue, thegetModelTimeSeries()method will return a list containing twoTimeSeriesinstances - one which will return the FEAT analysis input data, and another which will return the full model fit, for the voxel in question.Note
The
getDatamethod of aFEATTimeSeriesinstance will return the FEAT input data. Therefore, whenplotDataisTrue, theFEATTimeSeriesinstance will itself be included in the list returned bygetModelTimeSeries().The following classes are used to represent the various parts of a FEAT analysis:
FEATEVTimeSeriesA TimeSeriesclass which represents the time course of an EV from a FEAT analysis.FEATResidualTimeSeriesA VoxelTimeSeriesclass which represents the time course of the residuals from a FEAT analysis at a specific voxel.FEATPartialFitTimeSeriesA VoxelTimeSeriesclass which represents the partial model fit of an EV or contrast from a FEAT analysis at a specific voxel.FEATModelFitTimeSeriesA TimeSeriesclass which represents the time course for a model fit from a FEAT analysis at a specific voxel.-
plotData= <MagicMock name='mock.Boolean()' id='139845844115072'>¶ If
True, the FEAT input data is plotted.
-
plotResiduals= <MagicMock name='mock.Boolean()' id='139845844115072'>¶ If
True, the FEAT model residuals are plotted.
-
plotEVs= <MagicMock name='mock.List()' id='139845843011176'>¶ A list of
Booleanproperties, one for each EV in the FEAT analysis. For elements that areTrue, the corresponding FEAT EV time course is plotted.
-
plotPEFits= <MagicMock name='mock.List()' id='139845843011176'>¶ A list of
Booleanproperties, one for each EV in the FEAT analysis. For elements that areTrue, the model fit for the corresponding FEAT EV is plotted.
-
plotCOPEFits= <MagicMock name='mock.List()' id='139845843011176'>¶ A list of
Booleanproperties, one for each EV in the FEAT analysis. For elements that areTrue, the model fit for the corresponding FEAT contrast is plotted.
-
plotPartial= <MagicMock name='mock.Choice()' id='139845843612560'>¶ Plot the raw data, after regression against a chosen EV or contrast. The options are populated in the
__init__()method.
-
__init__(*args, **kwargs)¶ Create a
FEATTimeSeries.All arguments are passed through to the
VoxelTimeSeriesconstructor.
-
plotFullModelFit= <MagicMock name='mock.Boolean()' id='139845844115072'>¶ If
True, the FEAT full model fit is plotted.
-
getModelTimeSeries()¶ Returns a list containing all of the
TimeSeriesinstances which should be plotted in place of thisFEATTimeSeries.
-
_FEATTimeSeries__createModelTs(tsType, *args, **kwargs)¶ Creates a
TimeSeriesinstance of the giventsType, and sets its display settings according to those of thisFEATTimeSeries.Parameters: - tsType – The type to create, e.g.
FEATModelFitTimeSeries,FEATEVTimeSeries, etc. - args – Passed to the
tsTypeconstructor. - kwargs – Passed to the
tsTypeconstructor.
- tsType – The type to create, e.g.
-
_FEATTimeSeries__getContrast(fitType, idx)¶ Returns a contrast vector for the given model fit type, and index.
Parameters: - fitType – either
'full','pe', or'cope'. If'full', theidxargument is ignored. - idx – The EV or contrast index for
'pe'or'cope'model fits.
- fitType – either
-
_FEATTimeSeries__plotCOPEFitChanged(*a)¶ Called when the
plotCOPEFitssetting changes.If necessary, creates and caches one or more
FEATModelFitTimeSeriesinstances.
-
_FEATTimeSeries__plotEVChanged(*a)¶ Called when the
plotEVssetting changes.If necessary, creates and caches one or more
FEATEVTimeSeriesinstances.
-
_FEATTimeSeries__plotFullModelFitChanged(*a)¶ Called when the
plotFullModelFitsetting changes.If necessary, creates and caches a
FEATModelFitTimeSeriesinstance.
-
_FEATTimeSeries__plotPEFitChanged(*a)¶ Called when the
plotPEFitssetting changes.If necessary, creates and caches one or more
FEATModelFitTimeSeriesinstances.
-
_FEATTimeSeries__plotPartialChanged(*a)¶ Called when the
plotPartialsetting changes.If necessary, creates and caches a
FEATPartialFitTimeSeriesinstance.
-
_FEATTimeSeries__plotResidualsChanged(*a)¶ Called when the
plotResidualssetting changes.If necessary, creates and caches a
FEATResidualTimeSeriesinstance.
-
__module__= 'fsleyes.plotting.timeseries'¶
-
-
class
fsleyes.plotting.timeseries.FEATPartialFitTimeSeries(overlay, overlayList, displayCtx, plotPanel, parentTs, contrast, fitType, idx)¶ Bases:
fsleyes.plotting.timeseries.VoxelTimeSeriesA
VoxelTimeSeriesclass which represents the partial model fit of an EV or contrast from a FEAT analysis at a specific voxel. Instances of this class are created by theFEATTimeSeriesclass.-
__init__(overlay, overlayList, displayCtx, plotPanel, parentTs, contrast, fitType, idx)¶ Create a
FEATPartialFitTimeSeries.Parameters: - overlay – The
FEATImageinstance to extract the data from. - overlayList – The
OverlayListinstance. - displayCtx – The
DisplayContextinstance. - plotPanel – The
TimeSeriesPanelwhich owns thisFEATPartialFitTimeSeries. - parentTs – The
FEATTimeSeriesinstance that has created thisFEATPartialFitTimeSeries. - contrast – The contrast vector to calculate the partial model fit for.
- fitType – The model fit type, either
'full','pe'or'cope'. - idx – If the model fit type is
'pe'or'cope', the EV/contrast index.
- overlay – The
-
getData()¶ Returns the partial model fit for the voxel and model fit type specified in the constructop.
See the
FEATImage.partialFit()method.
-
__module__= 'fsleyes.plotting.timeseries'¶
-
-
class
fsleyes.plotting.timeseries.FEATEVTimeSeries(overlay, overlayList, displayCtx, plotPanel, parentTs, idx)¶ Bases:
fsleyes.plotting.timeseries.TimeSeriesA
TimeSeriesclass which represents the time course of an EV from a FEAT analysis. Instances of this class are created by theFEATTimeSeriesclass.-
__init__(overlay, overlayList, displayCtx, plotPanel, parentTs, idx)¶ Create a
FEATEVTimeSeries.Parameters: - overlay – The
FEATImageinstance to extract the data from. - overlayList – The
OverlayListinstance. - displayCtx – The
DisplayContextinstance. - plotPanel – The
TimeSeriesPanelwhich owns thisFEATEVTimeSeries. - parentTs – The
FEATTimeSeriesinstance that has created thisFEATEVTimeSeries. - idx – The EV index.
- overlay – The
-
makeLabel()¶ Returns a string representation of this
FEATEVTimeSeriesinstance.
-
getData()¶ Returns the time course of the EV specified in the constructor.
-
__module__= 'fsleyes.plotting.timeseries'¶
-
-
class
fsleyes.plotting.timeseries.FEATResidualTimeSeries(overlay, overlayList, displayCtx, plotPanel, parentTs)¶ Bases:
fsleyes.plotting.timeseries.VoxelTimeSeriesA
VoxelTimeSeriesclass which represents the time course of the residuals from a FEAT analysis at a specific voxel. Instances of this class are created by theFEATTimeSeriesclass.-
__init__(overlay, overlayList, displayCtx, plotPanel, parentTs)¶ Create a
FEATResidualTimeSeries.Parameters: - overlay – The
FEATImageinstance to extract the data from. - overlayList – The
OverlayListinstance. - displayCtx – The
DisplayContextinstance. - plotPanel – The
TimeSeriesPanelwhich owns thisFEATResidualTimeSeries. - parentTs – The
FEATTimeSeriesinstance that has created thisFEATResidualTimeSeries.
- overlay – The
-
makeLabel()¶ Returns a string representation of this
FEATResidualTimeSeriesinstance.
-
getData()¶ Returns the residuals for the current voxel.
-
__module__= 'fsleyes.plotting.timeseries'¶
-
-
class
fsleyes.plotting.timeseries.FEATModelFitTimeSeries(overlay, overlayList, displayCtx, plotPanel, parentTs, contrast, fitType, idx)¶ Bases:
fsleyes.plotting.timeseries.VoxelTimeSeriesA
TimeSeriesclass which represents the time course for a model fit from a FEAT analysis at a specific voxel. Instances of this class are created by theFEATTimeSeriesclass.-
__init__(overlay, overlayList, displayCtx, plotPanel, parentTs, contrast, fitType, idx)¶ Create a
FEATModelFitTimeSeries.Parameters: - overlay – The
FEATImageinstance to extract the data from. - overlayList – The
OverlayListinstance. - displayCtx – The
DisplayContextinstance. - plotPanel – The
TimeSeriesPanelwhich owns thisFEATModelFitTimeSeries. - parentTs – The
FEATTimeSeriesinstance that has created thisFEATModelFitTimeSeries. - contrast – The contrast vector to calculate the partial model fit for.
- fitType – The model fit type, either
'full','pe'or'cope'. - idx – If the model fit type is
'pe'or'cope',
- overlay – The
-
makeLabel()¶ Returns a string representation of this
FEATModelFitTimeSeriesinstance.
-
getData()¶ Returns the FEAT model fit at the current voxel.
-
__module__= 'fsleyes.plotting.timeseries'¶
-
-
class
fsleyes.plotting.timeseries.MelodicTimeSeries(overlay, overlayList, displayCtx, plotPanel)¶ Bases:
fsleyes.plotting.timeseries.TimeSeriesA
TimeSeriesclass which encapsulates the time course for one component of aMelodicImage. ThegetData()method returns the time course of the component specified by the currentNiftiOpts.volume.-
__init__(overlay, overlayList, displayCtx, plotPanel)¶ Create a
MelodicTimeSeries.Parameters: - overlay – A
MelodicImageoverlay. - overlayList – The
OverlayListinstance. - displayCtx – The
DisplayContextinstance. - plotPanel – The
TimeSeriesPanelwhich owns thisMelodicTimeSeries.
- overlay – A
-
__module__= 'fsleyes.plotting.timeseries'¶
-
getComponent()¶ Returns the index (starting from 0) of the current Melodic component, as dictated by the
NiftiOpts.volumeproperty.
-
makeLabel()¶ Returns a string representation of this
MelodicTimeSeries.
-
getData()¶ Returns the time course of the current Melodic component.
-
-
class
fsleyes.plotting.timeseries.MeshTimeSeries(overlay, overlayList, displayCtx, plotPanel)¶ Bases:
fsleyes.plotting.timeseries.TimeSeriesA
MeshTimeSeriesobject encapsulates the time course for aMeshoverlay which has some time series vertex data associated with it. See theMeshOpts.vertexDataproperty.-
_MeshTimeSeries__haveData()¶ Returns
Trueif there is currently time series data to show for thisMeshTimeSeries,Falseotherwise.
-
__module__= 'fsleyes.plotting.timeseries'¶
-
__init__(overlay, overlayList, displayCtx, plotPanel)¶ Create a
MeshTimeSeriesinstance.Parameters: - overlay – The
Meshinstance to extract the data from. - overlayList – The
OverlayListinstance. - displayCtx – The
DisplayContextinstance. - plotPanel – The
TimeSeriesPanelwhich owns thisTimeSeries.
- overlay – The
-
makeLabel()¶ Returns a label to use for this
MeshTimeSerieson the legend.
-
getData(xdata=None, ydata=None)¶ Returns the data at the current location for the
Mesh, or[], []if there is no data.
-