fsleyes.plotting.powerspectrumseries
¶
This module provides DataSeries
sub-classes which are used
by the PowerSpectrumPanel
for plotting power spectra.
The following classes are provided:
The |
|
The |
|
This class is the frequency-spectrum equivalent of the |
|
An |
|
An |
|
An |
|
The |
-
fsleyes.plotting.powerspectrumseries.
calcPowerSpectrum
(data, varNorm=False)[source]¶ Calculates a power spectrum for the given one-dimensional data array. If
varNorm is True
, the data is de-meaned and normalised by its standard deviation before the fourier transformation.- Parameters
data – Numpy array containing the time series data
varNorm – Normalise the data before fourier transformation
- Returns
If
data
contains real values, the magnitude of the power spectrum is returned. Ifdata
contains complex values, the complex power spectrum is returned.
-
fsleyes.plotting.powerspectrumseries.
calcFrequencies
(data, sampleTime)[source]¶ Calculates the frequencies of the power spectrum for the given data.
- Parameters
data – The input time series data
sampleTime – Time between each data point
- Returns
A
numpy
array containing the frequencies of the power spectrum fordata
-
fsleyes.plotting.powerspectrumseries.
magnitude
(data)[source]¶ Returns the magnitude of the given complex data.
-
fsleyes.plotting.powerspectrumseries.
phase
(data)[source]¶ Returns the phase of the given complex data.
-
fsleyes.plotting.powerspectrumseries.
phaseCorrection
(spectrum, freqs, p0, p1)[source]¶ Applies phase correction to the given complex power spectrum.
- Parameters
spectrum – Complex-valued power spectrum
freqs – Spectrum frequency bins
p0 – Zero order phase correction term
p1 – First order phase correction term
- Returns
The corrected power spectrum.
-
class
fsleyes.plotting.powerspectrumseries.
PowerSpectrumSeries
[source]¶ Bases:
object
The
PowerSpectrumSeries
encapsulates a power spectrum data series from an overlay. ThePowerSpectrumSeries
class is a base mixin class for all other classes in this module.-
varNorm
= <MagicMock name='mock.Boolean()' id='4396609964304'>¶ If
True
, the data is normalised to unit variance before the fourier transformation.
-
property
sampleTime
¶ Returns the time between time series samples for the overlay data.
-
__dict__
= mappingproxy({'__module__': 'fsleyes.plotting.powerspectrumseries', '__doc__': 'The ``PowerSpectrumSeries`` encapsulates a power spectrum data series\n from an overlay. The ``PowerSpectrumSeries`` class is a base mixin class\n for all other classes in this module.\n ', 'varNorm': <MagicMock name='mock.Boolean()' id='4396609964304'>, 'sampleTime': <property object>, '__dict__': <attribute '__dict__' of 'PowerSpectrumSeries' objects>, '__weakref__': <attribute '__weakref__' of 'PowerSpectrumSeries' objects>})¶
-
__module__
= 'fsleyes.plotting.powerspectrumseries'¶
-
__weakref__
¶ list of weak references to the object (if defined)
-
-
class
fsleyes.plotting.powerspectrumseries.
VoxelPowerSpectrumSeries
(*args, **kwargs)[source]¶ Bases:
fsleyes.plotting.dataseries.VoxelDataSeries
,fsleyes.plotting.powerspectrumseries.PowerSpectrumSeries
The
VoxelPowerSpectrumSeries
class encapsulates the power spectrum of a single voxel from a 4DImage
overlay. The voxel is dictated by theDisplayContext.location
property.-
__init__
(*args, **kwargs)[source]¶ Create a
VoxelPowerSpectrumSeries
. All arguments are passed to theVoxelDataSeries.__init__()
method. AValueError
is raised if the overlay is not a 4DImage
.
-
__module__
= 'fsleyes.plotting.powerspectrumseries'¶
-
-
class
fsleyes.plotting.powerspectrumseries.
ComplexPowerSpectrumSeries
(overlay, overlayList, displayCtx, plotPanel)[source]¶ Bases:
fsleyes.plotting.powerspectrumseries.VoxelPowerSpectrumSeries
This class is the frequency-spectrum equivalent of the
ComplexTimeSeries
class - see it for more details.-
plotReal
= <MagicMock name='mock.Boolean()' id='4396609964304'>¶
-
plotImaginary
= <MagicMock name='mock.Boolean()' id='4396609964304'>¶
-
plotMagnitude
= <MagicMock name='mock.Boolean()' id='4396609964304'>¶
-
plotPhase
= <MagicMock name='mock.Boolean()' id='4396609964304'>¶
-
zeroOrderPhaseCorrection
= <MagicMock name='mock.Real()' id='4396607039088'>¶ Apply zero order phase correction to the power spectrum of the complex data.
-
firstOrderPhaseCorrection
= <MagicMock name='mock.Real()' id='4396607039088'>¶ Apply first order phase correction to the power spectrum of the complex data.
-
__init__
(overlay, overlayList, displayCtx, plotPanel)[source]¶ Create a
ComplexPowerSpectrumSeries
. All arguments are passed through to theVoxelPowerSpectrumSeries
constructor.
-
getData
()[source]¶ If
plotReal
is true, returns the real component of the power spectrum of the data at the current voxel. Otherwise returns(None, None)
.Every time this method is called, the power spectrum is calculated, phase correction is applied, and a reference to the resulting complex power spectrum (and frequencies) is saved; it is accessible via the
cachedData()
property, for use by theImaginaryPowerSpectrumSeries
,MagnitudePowerSpectrumSeries
, andPhasePowerSpectrumSeries
.
-
extraSeries
()[source]¶ Returns a list of additional series to be plotted, based on the values of the
plotImaginary
,plotMagnitude
andplotPhase
properties.
-
__module__
= 'fsleyes.plotting.powerspectrumseries'¶
-
-
class
fsleyes.plotting.powerspectrumseries.
ImaginaryPowerSpectrumSeries
(parent, *args, **kwargs)[source]¶ Bases:
fsleyes.plotting.dataseries.DataSeries
An
ImaginaryPowerSpectrumSeries
represents the power spectrum of the imaginary component of a complex-valued image.ImaginaryPowerSpectrumSeries
instances are created byComplexPowerSpectrumSeries
instances.-
__init__
(parent, *args, **kwargs)[source]¶ Create an
ImaginaryPowerSpectrumSeries
.- Parameters
parent – The
ComplexPowerSpectrumSeries
which owns thisImaginaryPowerSpectrumSeries
.
All other arguments are passed through to the
DataSeries
constructor.
-
__module__
= 'fsleyes.plotting.powerspectrumseries'¶
-
-
class
fsleyes.plotting.powerspectrumseries.
MagnitudePowerSpectrumSeries
(parent, *args, **kwargs)[source]¶ Bases:
fsleyes.plotting.dataseries.DataSeries
An
MagnitudePowerSpectrumSeries
represents the magnitude of a complex-valued image.MagnitudePowerSpectrumSeries
instances are created byComplexPowerSpectrumSeries
instances.-
__init__
(parent, *args, **kwargs)[source]¶ Create an
ImaginaryPowerSpectrumSeries
.- Parameters
parent – The
ComplexPowerSpectrumSeries
which owns thisImaginaryPowerSpectrumSeries
.
All other arguments are passed through to the
DataSeries
constructor.
-
__module__
= 'fsleyes.plotting.powerspectrumseries'¶
-
-
class
fsleyes.plotting.powerspectrumseries.
PhasePowerSpectrumSeries
(parent, *args, **kwargs)[source]¶ Bases:
fsleyes.plotting.dataseries.DataSeries
An
PhasePowerSpectrumSeries
represents the phase of a complex-valued image.PhasePowerSpectrumSeries
instances are created byComplexPowerSpectrumSeries
instances.-
__init__
(parent, *args, **kwargs)[source]¶ Create an
ImaginaryPowerSpectrumSeries
.- Parameters
parent – The
ComplexPowerSpectrumSeries
which owns thisImaginaryPowerSpectrumSeries
.
All other arguments are passed through to the
DataSeries
constructor.
-
__module__
= 'fsleyes.plotting.powerspectrumseries'¶
-
-
class
fsleyes.plotting.powerspectrumseries.
MelodicPowerSpectrumSeries
(*args, **kwargs)[source]¶ Bases:
fsleyes.plotting.dataseries.DataSeries
,fsleyes.plotting.powerspectrumseries.PowerSpectrumSeries
The
MelodicPowerSpectrumSeries
class encapsulates the power spectrum of the time course for a single component of aMelodicImage
. The component is dictated by theNiftiOpts.volume
property.-
__init__
(*args, **kwargs)[source]¶ Create a
MelodicPowerSpectrumSeries
. All arguments are passed through to thePowerSpectrumSeries.__init__()
method.
-
getData
()[source]¶ Returns the power spectrum for the current component of the
MelodicImage
, as defined by theNiftiOpts.volume
property.
-
__module__
= 'fsleyes.plotting.powerspectrumseries'¶
-
-
class
fsleyes.plotting.powerspectrumseries.
MeshPowerSpectrumSeries
(*args, **kwargs)[source]¶ Bases:
fsleyes.plotting.dataseries.DataSeries
,fsleyes.plotting.powerspectrumseries.PowerSpectrumSeries
A
MeshPowerSpectrumSeries
object encapsulates the power spectrum for the data from aMesh
overlay which has some time series vertex data associated with it. See theMeshOpts.vertexData
property.-
__init__
(*args, **kwargs)[source]¶ Create a
MeshPowerSpectrumSeries
instance. All arguments are passed through toDataSeries.__init__()
.
-
__module__
= 'fsleyes.plotting.powerspectrumseries'¶
-
__haveData
()¶ Returns
True
if there is currently time series data to show for thisMeshPowerSpectrumSeries
,False
otherwise.
-