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='140225920543424'>¶ For images with the NIfTI
RGB24
orRGBA32
data type, this property controls the channel that gets displayed.
-
clipImage
= <MagicMock name='mock.Choice()' id='140225920543424'>¶ 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
, and which has the same voxel dimensions as the primary image can be selected for clipping. TheColourMapOpts.clippingRange
property dictates the values outside of which voxels are clipped.
-
interpolation
= <MagicMock name='mock.Choice()' id='140225920543424'>¶ 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
.
-
_VolumeOpts__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
-
_VolumeOpts__dataRangeChanged
(*a)¶ Called when the
Image.dataRange
property changes. CallsColourMapOpts.updateDataRange()
.
-
_VolumeOpts__enableOverrideDataRangeChanged
(*a)¶ Called when the
enableOverrideDataRange
property changes. CallsColourMapOpts.updateDataRange()
.
-
_VolumeOpts__overlayListChanged
(*a)¶ Called when the :class:.OverlayList` changes. Updates the options of the
clipImage
property.
-
_VolumeOpts__overrideDataRangeChanged
(*a)¶ Called when the
overrideDataRange
property changes. CallsColourMapOpts.updateDataRange()
.
-
__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='140225918680896'>¶ Colour to use for the red channel.
-
gColour
= <MagicMock name='mock.Colour()' id='140225918680896'>¶ Colour to use for the green channel.
-
bColour
= <MagicMock name='mock.Colour()' id='140225918680896'>¶ Colour to use for the blue channel.
-
suppressR
= <MagicMock name='mock.Boolean()' id='140225918039088'>¶ Suppress the R channel.
-
suppressG
= <MagicMock name='mock.Boolean()' id='140225918039088'>¶ Suppress the G channel.
-
suppressB
= <MagicMock name='mock.Boolean()' id='140225918039088'>¶ Suppress the B channel.
-
suppressA
= <MagicMock name='mock.Boolean()' id='140225918039088'>¶ Suppress the A channel.
-
suppressMode
= <MagicMock name='mock.Choice()' id='140225920543424'>¶ How colours should be suppressed.
-
interpolation
= <MagicMock name='mock.Choice()' id='140225911457104'>¶
-
__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.-
_ComplexOpts__componentChanged
(*a)¶ Called when the
component
changes. CallsColourMapOpts.updateDataRange()
.
-
__module__
= 'fsleyes.displaycontext.volumeopts'¶
-
component
= <MagicMock name='mock.Choice()' id='140225920543424'>¶ 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
.
-