fsleyes.plotting.powerspectrumseries

This module provides DataSeries sub-classes which are used by the PowerSpectrumPanel for plotting power spectra.

The following classes are provided:

PowerSpectrumSeries The PowerSpectrumSeries encapsulates a power spectrum data series from an overlay.
VoxelPowerSpectrumSeries The VoxelPowerSpectrumSeries class encapsulates the power spectrum of a single voxel from a 4D Image overlay.
MelodicPowerSpectrumSeries The MelodicPowerSpectrumSeries class encapsulates the power spectrum of the time course for a single component of a MelodicImage.
class fsleyes.plotting.powerspectrumseries.PowerSpectrumSeries(overlay, overlayList, displayCtx, plotPanel)

Bases: fsleyes.plotting.dataseries.DataSeries

The PowerSpectrumSeries encapsulates a power spectrum data series from an overlay. The PowerSpectrumSeries class is the base class for all other classes in this module. It provides the calcPowerSpectrum() method which (surprisingly) calculates the power spectrum of a data series.

varNorm = <MagicMock name='mock.Boolean()' id='4122918732'>

If True, the data is normalised to unit variance before the fourier transformation.

__init__(overlay, overlayList, displayCtx, plotPanel)

Create a PowerSpectrumSeries.

Parameters:
  • overlay – The overlay from which the data to be plotted is retrieved.
  • overlayList – The OverlayList instance.
  • displayCtx – The DisplayContext instance.
  • plotPanel – The PlotPanel that owns this PowerSpectrumSeries.
destroy()

Must be called when this PowerSpectrumSeries is no longer needed.

makeLabel()

Returns a label that can be used for this PowerSpectrumSeries.

calcPowerSpectrum(data)

Calculates a power spectrum for the given one-dimensional data array. If the varNorm property is True, the data is de-meaned and normalised by its standard deviation before the fourier transformation.

__module__ = 'fsleyes.plotting.powerspectrumseries'
class fsleyes.plotting.powerspectrumseries.VoxelPowerSpectrumSeries(*args, **kwargs)

Bases: fsleyes.plotting.powerspectrumseries.PowerSpectrumSeries

The VoxelPowerSpectrumSeries class encapsulates the power spectrum of a single voxel from a 4D Image overlay. The voxel is dictated by the DisplayContext.location property.

__init__(*args, **kwargs)

Create a VoxelPowerSpectrumSeries. All arguments are passed to the PowerSpectrumSeries.__init__() method. A ValueError is raised if the overlay is not a 4D Image.

makeLabel()

Creates and returns a label for use with this VoxelPowerSpectrumSeries.

getData = <MagicMock name='mock.utils.idle.mutex()' id='4120700332'>
__module__ = 'fsleyes.plotting.powerspectrumseries'
class fsleyes.plotting.powerspectrumseries.MelodicPowerSpectrumSeries(*args, **kwargs)

Bases: fsleyes.plotting.powerspectrumseries.PowerSpectrumSeries

The MelodicPowerSpectrumSeries class encapsulates the power spectrum of the time course for a single component of a MelodicImage. The component is dictated by the NiftiOpts.volume property.

__init__(*args, **kwargs)

Create a MelodicPowerSpectrumSeries. All arguments are passed through to the PowerSpectrumSeries.__init__() method.

makeLabel()

Returns a label that can be used for this MelodicPowerSpectrumSeries.

getData()

Returns the power spectrum for the current component of the MelodicImage, as defined by the NiftiOpts.volume property.

__module__ = 'fsleyes.plotting.powerspectrumseries'
class fsleyes.plotting.powerspectrumseries.MeshPowerSpectrumSeries(*args, **kwargs)

Bases: fsleyes.plotting.powerspectrumseries.PowerSpectrumSeries

A MeshPowerSpectrumSeries object encapsulates the power spectrum for the data from a Mesh overlay which has some time series vertex data associated with it. See the MeshOpts.vertexData property.

__init__(*args, **kwargs)

Create a MeshPowerSpectrumSeries instance. All arguments are passed through to PowerSpectrumSeries.__init__().

makeLabel()

Returns a label to use for this MeshPowerSpectrumSeries on the legend.

_MeshPowerSpectrumSeries__haveData()

Returns True if there is currently time series data to show for this MeshPowerSpectrumSeries, False otherwise.

__module__ = 'fsleyes.plotting.powerspectrumseries'
getData()

Returns the power spectrum of the data at the current location for the Mesh, or [], [] if there is no data.