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)¶ Bases:
__main__.MockClass
A
DataSeries
instance 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
, andPlotPanel
in their__init__
method, and pass these through toDataSeries.__init__()
.Override the
getData()
methodOverride the
redrawProperties()
method if necessary
The overlay is accessible as an instance attribute, confusingly called
overlay
.Note
Some
DataSeries
instances may not be associated with an overlay (e.g. series imported loaded a text file). In this case, theoverlay
attribute will beNone
.Each``DataSeries`` instance is plotted as a line, with the line style defined by properties on the
DataSeries
instance, such ascolour
,lineWidth
etc.-
colour
= <MagicMock name='mock.Colour()' id='140735848816272'>¶ Line colour.
-
enabled
= <MagicMock name='mock.Boolean()' id='140735851538640'>¶ Draw or not draw?
-
alpha
= <MagicMock name='mock.Real()' id='140735894843600'>¶ Line transparency.
-
label
= <MagicMock name='mock.String()' id='140735848727888'>¶ Line label (used in the plot legend).
-
lineWidth
= <MagicMock name='mock.Choice()' id='140735848912272'>¶ Line width.
-
lineStyle
= <MagicMock name='mock.Choice()' id='140735848912272'>¶ Line style.
-
__init__
(overlay, overlayList, displayCtx, plotPanel)¶ Create a
DataSeries
.- Parameters
overlay – The overlay from which the data to be plotted is retrieved. May be
None
.overlayList – The
OverlayList
instance.displayCtx – The
DisplayContext
instance.plotPanel – The
PlotPanel
that owns thisDataSeries
.
-
__del__
()¶ Prints a log message.
-
__hash__
()¶ Returns a hash for this
DataSeries
instance.
-
property
name
¶ Returns a unique name for this
DataSeries
instance.
-
property
overlay
¶ Returns the overlay associated with this
DataSeries
instance.
-
property
overlayList
¶ Returns the
OverlayList
.
-
property
displayCtx
¶ Returns the
DisplayContext
.
-
destroy
()¶ This method must be called when this
DataSeries
instance 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
()¶ Returns a list of all properties which, when their values change, should result in this
DataSeries
being re-plotted. This method may be overridden by sub-classes.
-
extraSeries
()¶ Some
DataSeries
types have additionalDataSeries
associated with them (see e.g. theFEATTimeSeries
class). This method can be overridden to return a list of these extraDataSeries
instances. The default implementation returns an empty list.
-
setData
(xdata, ydata)¶ Set the data to be plotted. This method is irrelevant if a
DataSeries
sub-class has overriddengetData()
.
-
getData
()¶ 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
xdata
andydata
are 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'¶
-
class
fsleyes.plotting.dataseries.
VoxelDataSeries
(*args, **kwargs)¶ Bases:
fsleyes.plotting.dataseries.DataSeries
The
VoxelDataSeries
class is aDataSeries
class which provides some functionality useful to data series that represent data from a voxel in anImage
overlay.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)¶ Create a
VoxelDataSeries
. All arguments are passed through to theDataSeries
constructor.
-
makeLabel
()¶ Returns a string representation of this
VoxelDataSeries
instance.
-
getData
()¶ Returns the data at the current voxel location.
-
dataAtCurrentVoxel
= <MagicMock name='mock.utils.idle.mutex()' id='140735848674128'>¶
-