fsleyes.plotting.dataseries¶
This module provides the DataSeries class, the base class for
classes used by PlotPanel views for plotting data.
-
class
fsleyes.plotting.dataseries.DataSeries(overlay, overlayList, displayCtx, plotPanel)[source]¶ Bases:
__main__.MockClassA
DataSeriesinstance encapsulates some data to be plotted by aPlotPanel, with the data extracted from an overlay in theOverlayList.Sub-class implementations must:
- Accept an overlay object,
OverlayList,DisplayContext, andPlotPanelin their__init__method, and pass these through toDataSeries.__init__(). - Override the
getData()method - Override the
redrawProperties()method if necessary
The overlay is accessible as an instance attribute, confusingly called
overlay.Note
Some
DataSeriesinstances may not be associated with an overlay (e.g. series imported loaded a text file). In this case, theoverlayattribute will beNone.Each``DataSeries`` instance is plotted as a line, with the line style defined by properties on the
DataSeriesinstance, such ascolour,lineWidthetc.-
colour= <MagicMock name='mock.Colour()' id='4123551660'>¶ Line colour.
-
enabled= <MagicMock name='mock.Boolean()' id='4122041612'>¶ Draw or not draw?
-
alpha= <MagicMock name='mock.Real()' id='4122086412'>¶ Line transparency.
-
label= <MagicMock name='mock.String()' id='4122128716'>¶ Line label (used in the plot legend).
-
lineWidth= <MagicMock name='mock.Choice()' id='4122375244'>¶ Line width.
-
lineStyle= <MagicMock name='mock.Choice()' id='4122375244'>¶ Line style.
-
__init__(overlay, overlayList, displayCtx, plotPanel)[source]¶ Create a
DataSeries.Parameters: - overlay – The overlay from which the data to be plotted is
retrieved. May be
None. - overlayList – The
OverlayListinstance. - displayCtx – The
DisplayContextinstance. - plotPanel – The
PlotPanelthat owns thisDataSeries.
- overlay – The overlay from which the data to be plotted is
retrieved. May be
-
name¶ Returns a unique name for this
DataSeriesinstance.
-
overlay¶ Returns the overlay associated with this
DataSeriesinstance.
-
overlayList¶ Returns the
OverlayList.
-
displayCtx¶ Returns the
DisplayContext.
-
plotPanel¶ Returns the
PlotPanelthat owns thisDataSeriesinstance.
-
destroy()[source]¶ This method must be called when this
DataSeriesinstance is no longer needed. This implementation may be overridden by sub-classes which need to perform any clean-up operations. Sub-class implementations should call this implementation.
-
redrawProperties()[source]¶ Returns a list of all properties which, when their values change, should result in this
DataSeriesbeing re-plotted. This method may be overridden by sub-classes.
-
extraSeries()[source]¶ Some
DataSeriestypes have additionalDataSeriesassociated with them (see e.g. theFEATTimeSeriesclass). This method can be overridden to return a list of these extraDataSeriesinstances. The default implementation returns an empty list.
-
setData(xdata, ydata)[source]¶ Set the data to be plotted. This method is irrelevant if a
DataSeriessub-class has overriddengetData().
-
getData()[source]¶ This method should be overridden by sub-classes. It must return the data to be plotted, as a tuple of the form:
(xdata, ydata)where
xdataandydataare sequences containing the x/y data to be plotted.The default implementation returns the data that has been set via the
setData()method.
-
__module__= 'fsleyes.plotting.dataseries'¶
- Accept an overlay object,
-
class
fsleyes.plotting.dataseries.VoxelDataSeries(*args, **kwargs)[source]¶ Bases:
fsleyes.plotting.dataseries.DataSeriesThe
VoxelDataSeriesclass is aDataSeriesclass which provides some functionality useful to data series that represent data from a voxel in anImageoverlay.It contains a built-in cache which is used to prevent repeated access to data from the same voxel.
-
__module__= 'fsleyes.plotting.dataseries'¶
-
__init__(*args, **kwargs)[source]¶ Create a
VoxelDataSeries. All arguments are passed through to theDataSeriesconstructor.
-
dataAtCurrentVoxel= <MagicMock name='mock.utils.idle.mutex()' id='4123798668'>¶
-