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 displayingImage
instances as regular 3D volumes.- channel = <MagicMock name='mock.Choice()' id='140112346301776'>
For images with the NIfTI
RGB24
orRGBA32
data type, this property controls the channel that gets displayed.
- clipImage = <MagicMock name='mock.Choice()' id='140112346301776'>
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. TheColourMapOpts.clippingRange
property dictates the values outside of which voxels are clipped.
- modulateImage = <MagicMock name='mock.Choice()' id='140112346301776'>
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='140112346301776'>
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 theColourMapOpts.displayRange
andColourMapOpts.clippingRange
properties. If the initial display range has not yet been set (via thesetInitialDisplayRange()
method),None
is returned.
- classmethod setInitialDisplayRange(drange)[source]
Sets the initial values for the
ColourMapOpts.displayRange
andColourMapOpts.clippingRange
to be used for newVolumeOpts
instances.- Parameters
drange – A tuple containing
(low, high)
display range values as percentiles of the image data range. May beNone
, 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 specifiedoverlay
, assumed to be anImage
instance.All arguments are passed through to the
DisplayOpts
constructor.
- getDataRange()[source]
Overrides
ColourMapOpts.getDataRange()
. Returns theImage.dataRange
of the image, or theoverrideDataRange
if it is active.
- getClippingRange()[source]
Overrides
ColourMapOpts.getClippingRange()
. If aclipImage
is set, returns its data range. Otherwise returnsNone
.
- getModulateRange()[source]
Overrides
ColourMapOpts.getModulateRange()
. If amodulateImage
is set, returns its data range. Otherwise returnsNone
.
- __dataRangeChanged(*a)
Called when the
Image.dataRange
property changes. CallsColourMapOpts.updateDataRange()
.
- __enableOverrideDataRangeChanged(*a)
Called when the
enableOverrideDataRange
property changes. CallsColourMapOpts.updateDataRange()
.
- __overrideDataRangeChanged(*a)
Called when the
overrideDataRange
property changes. CallsColourMapOpts.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
. IfFalse
, theColourMapOpts.updateDataRange()
method is not called.
- Called when the
- __modulateImageChanged(*a, **kwa)
- Called when the
modulateImage
property is changed. Updates the range of the
modulateRange
property.
- Parameters
updateDataRange – Defaults to
True
. IfFalse
, theColourMapOpts.updateDataRange()
method is not called.
- Called when the
- __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 displayingImage
instances containing RGB(A) data.- rColour = <MagicMock name='mock.Colour()' id='140112348024448'>
Colour to use for the red channel.
- gColour = <MagicMock name='mock.Colour()' id='140112348024448'>
Colour to use for the green channel.
- bColour = <MagicMock name='mock.Colour()' id='140112348024448'>
Colour to use for the blue channel.
- suppressR = <MagicMock name='mock.Boolean()' id='140112348499920'>
Suppress the R channel.
- suppressG = <MagicMock name='mock.Boolean()' id='140112348499920'>
Suppress the G channel.
- suppressB = <MagicMock name='mock.Boolean()' id='140112348499920'>
Suppress the B channel.
- suppressA = <MagicMock name='mock.Boolean()' id='140112348499920'>
Suppress the A channel.
- suppressMode = <MagicMock name='mock.Choice()' id='140112346301776'>
How colours should be suppressed.
- interpolation = <MagicMock name='mock.Choice()' id='140112346965728'>
- __annotations__ = {}
- __init__(overlay, display, overlayList, displayCtx, **kwargs)[source]
Create a
VolumeRGBOpts
instance for the specifiedoverlay
, assumed to be anImage
instance with typeNIFTI_TYPE_RGB24
orNIFTI_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 ofVolumeOpts
for images with a complex data type.- __annotations__ = {}
- __module__ = 'fsleyes.displaycontext.volumeopts'
- component = <MagicMock name='mock.Choice()' id='140112346301776'>
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 theVolumeOpts
constructor.
- getDataRange()[source]
Overrides
ColourMapOpts.getDataRange()
. Calculates and returns the data range of the currentcomponent
.
- getComponent(data)[source]
Calculates and returns the current
component
from the given data, assumed to be complex.
- __componentChanged(*a)
Called when the
component
changes. CallsColourMapOpts.updateDataRange()
.