fsleyes.displaycontext.volumeopts

This module defines the VolumeOpts class.

class fsleyes.displaycontext.volumeopts.VolumeOpts(overlay, display, overlayList, displayCtx, **kwargs)[source]

Bases: fsleyes.displaycontext.colourmapopts.ColourMapOpts, fsleyes.displaycontext.volume3dopts.Volume3DOpts, fsleyes.displaycontext.niftiopts.NiftiOpts

The VolumeOpts class defines options for displaying Image instances as regular 3D volumes.

channel = <MagicMock name='mock.Choice()' id='4118567808'>

For images with the NIfTI RGB24 or RGBA32 data type, this property controls the channel that gets displayed.

clipImage = <MagicMock name='mock.Choice()' id='4118567808'>

Clip voxels according to the values in another image. By default, voxels are clipped by the values in the image itself - this property allows the user to choose another image by which voxels are to be clipped. Any image which is in the OverlayList can be selected for clipping. The ColourMapOpts.clippingRange property dictates the values outside of which voxels are clipped.

modulateImage = <MagicMock name='mock.Choice()' id='4118567808'>

Modulate alapha (opacity) by the intensity of values in the selected image, instead of in this image. Only relevant when ColourMapOpts.modulateAlpha is active.

interpolation = <MagicMock name='mock.Choice()' id='4118567808'>

How the value shown at a real world location is derived from the corresponding data value(s). none is equivalent to nearest neighbour interpolation.

classmethod getInitialDisplayRange()[source]

This class method returns a tuple containing (low, high) percentile values which are used to set the initial values for the ColourMapOpts.displayRange and ColourMapOpts.clippingRange properties. If the initial display range has not yet been set (via the setInitialDisplayRange() method), None is returned.

classmethod setInitialDisplayRange(drange)[source]

Sets the initial values for the ColourMapOpts.displayRange and ColourMapOpts.clippingRange to be used for new VolumeOpts instances.

Parameters

drange – A tuple containing (low, high) display range values as percentiles of the image data range. May be None, in which case the initial display range will be set to the image data range.

__init__(overlay, display, overlayList, displayCtx, **kwargs)[source]

Create a VolumeOpts instance for the specified overlay, assumed to be an Image instance.

All arguments are passed through to the DisplayOpts constructor.

destroy()[source]

Removes property listeners, and calls the NiftiOpts.destroy() method.

getDataRange()[source]

Overrides ColourMapOpts.getDataRange(). Returns the Image.dataRange of the image, or the overrideDataRange if it is active.

getClippingRange()[source]

Overrides ColourMapOpts.getClippingRange(). If a clipImage is set, returns its data range. Otherwise returns None.

getModulateRange()[source]

Overrides ColourMapOpts.getModulateRange(). If a modulateImage is set, returns its data range. Otherwise returns None.

__dataRangeChanged(*a)

Called when the Image.dataRange property changes. Calls ColourMapOpts.updateDataRange().

__enableOverrideDataRangeChanged(*a)

Called when the enableOverrideDataRange property changes. Calls ColourMapOpts.updateDataRange().

__overrideDataRangeChanged(*a)

Called when the overrideDataRange property changes. Calls ColourMapOpts.updateDataRange().

__overlayListChanged(*a)

Called when the :class:.OverlayList` changes. Updates the options of the clipImage property.

__clipImageChanged(*a, **kwa)
Called when the clipImage property is changed. Updates

the range of the clippingRange property.

Parameters

updateDataRange – Defaults to True. If False, the ColourMapOpts.updateDataRange() method is not called.

__modulateImageChanged(*a, **kwa)
Called when the modulateImage property is changed. Updates

the range of the modulateRange property.

Parameters

updateDataRange – Defaults to True. If False, the ColourMapOpts.updateDataRange() method is not called.

__annotations__ = {}
__module__ = 'fsleyes.displaycontext.volumeopts'
class fsleyes.displaycontext.volumeopts.VolumeRGBOpts(overlay, display, overlayList, displayCtx, **kwargs)[source]

Bases: fsleyes.displaycontext.niftiopts.NiftiOpts

The VolumeRGBOpts class is intended for displaying Image instances containing RGB(A) data.

rColour = <MagicMock name='mock.Colour()' id='4118213728'>

Colour to use for the red channel.

gColour = <MagicMock name='mock.Colour()' id='4118213728'>

Colour to use for the green channel.

bColour = <MagicMock name='mock.Colour()' id='4118213728'>

Colour to use for the blue channel.

suppressR = <MagicMock name='mock.Boolean()' id='4118803744'>

Suppress the R channel.

suppressG = <MagicMock name='mock.Boolean()' id='4118803744'>

Suppress the G channel.

suppressB = <MagicMock name='mock.Boolean()' id='4118803744'>

Suppress the B channel.

suppressA = <MagicMock name='mock.Boolean()' id='4118803744'>

Suppress the A channel.

suppressMode = <MagicMock name='mock.Choice()' id='4118567808'>

How colours should be suppressed.

interpolation = <MagicMock name='mock.Choice()' id='4117766544'>

See VolumeOpts.interpolation.

__annotations__ = {}
__init__(overlay, display, overlayList, displayCtx, **kwargs)[source]

Create a VolumeRGBOpts instance for the specified overlay, assumed to be an Image instance with type NIFTI_TYPE_RGB24 or NIFTI_TYPE_RGBA32.

All arguments are passed through to the DisplayOpts constructor.

__module__ = 'fsleyes.displaycontext.volumeopts'
class fsleyes.displaycontext.volumeopts.ComplexOpts(*args, **kwargs)[source]

Bases: fsleyes.displaycontext.volumeopts.VolumeOpts

The ComplexOpts class is a specialisation of VolumeOpts for images with a complex data type.

__annotations__ = {}
__module__ = 'fsleyes.displaycontext.volumeopts'
component = <MagicMock name='mock.Choice()' id='4118567808'>

How to display the complex data:

  • 'real' - display the real component

  • 'imag'` - display the imaginary component

  • 'mag'` - display the magnitude

  • 'phase'` - display the phase

__init__(*args, **kwargs)[source]

Create a ComplexOpts. All arguments are passed through to the VolumeOpts constructor.

destroy()[source]

Must be called when this ComplexOpts is no longer needed.

getDataRange()[source]

Overrides ColourMapOpts.getDataRange(). Calculates and returns the data range of the current component.

getComponent(data)[source]

Calculates and returns the current component from the given data, assumed to be complex.

static getReal(data)[source]

Return the real component of the given complex data.

static getImaginary(data)[source]

Return the imaginary component of the given complex data.

static getMagnitude(data)[source]

Return the magnitude of the given complex data.

static getPhase(data)[source]

Return the phase of the given complex data.

__componentChanged(*a)

Called when the component changes. Calls ColourMapOpts.updateDataRange().