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.NiftiOptsThe
VolumeOptsclass defines options for displayingImageinstances as regular 3D volumes.-
channel= <MagicMock name='mock.Choice()' id='4117029600'>¶ For images with the NIfTI
RGB24orRGBA32data type, this property controls the channel that gets displayed.
-
clipImage= <MagicMock name='mock.Choice()' id='4117029600'>¶ 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
OverlayListcan be selected for clipping. TheColourMapOpts.clippingRangeproperty dictates the values outside of which voxels are clipped.
-
modulateImage= <MagicMock name='mock.Choice()' id='4117029600'>¶ Modulate alapha (opacity) by the intensity of values in the selected image, instead of in this image. Only relevant when
ColourMapOpts.modulateAlphais active.
-
interpolation= <MagicMock name='mock.Choice()' id='4117029600'>¶ How the value shown at a real world location is derived from the corresponding data value(s).
noneis 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.displayRangeandColourMapOpts.clippingRangeproperties. If the initial display range has not yet been set (via thesetInitialDisplayRange()method),Noneis returned.
-
classmethod
setInitialDisplayRange(drange)[source]¶ Sets the initial values for the
ColourMapOpts.displayRangeandColourMapOpts.clippingRangeto be used for newVolumeOptsinstances.- 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
VolumeOptsinstance for the specifiedoverlay, assumed to be anImageinstance.All arguments are passed through to the
DisplayOptsconstructor.
-
getDataRange()[source]¶ Overrides
ColourMapOpts.getDataRange(). Returns theImage.dataRangeof the image, or theoverrideDataRangeif it is active.
-
getClippingRange()[source]¶ Overrides
ColourMapOpts.getClippingRange(). If aclipImageis set, returns its data range. Otherwise returnsNone.
-
getModulateRange()[source]¶ Overrides
ColourMapOpts.getModulateRange(). If amodulateImageis set, returns its data range. Otherwise returnsNone.
-
__dataRangeChanged(*a)¶ Called when the
Image.dataRangeproperty changes. CallsColourMapOpts.updateDataRange().
-
__enableOverrideDataRangeChanged(*a)¶ Called when the
enableOverrideDataRangeproperty changes. CallsColourMapOpts.updateDataRange().
-
__overrideDataRangeChanged(*a)¶ Called when the
overrideDataRangeproperty changes. CallsColourMapOpts.updateDataRange().
-
__overlayListChanged(*a)¶ Called when the :class:.OverlayList` changes. Updates the options of the
clipImageproperty.
-
__clipImageChanged(*a, **kwa)¶ - Called when the
clipImageproperty is changed. Updates the range of the
clippingRangeproperty.
- Parameters
updateDataRange – Defaults to
True. IfFalse, theColourMapOpts.updateDataRange()method is not called.
- Called when the
-
__modulateImageChanged(*a, **kwa)¶ - Called when the
modulateImageproperty is changed. Updates the range of the
modulateRangeproperty.
- Parameters
updateDataRange – Defaults to
True. IfFalse, theColourMapOpts.updateDataRange()method is not called.
- Called when the
-
__module__= 'fsleyes.displaycontext.volumeopts'¶
-
-
class
fsleyes.displaycontext.volumeopts.VolumeRGBOpts(overlay, display, overlayList, displayCtx, **kwargs)[source]¶ Bases:
fsleyes.displaycontext.niftiopts.NiftiOptsThe
VolumeRGBOptsclass is intended for displayingImageinstances containing RGB(A) data.-
rColour= <MagicMock name='mock.Colour()' id='4116519520'>¶ Colour to use for the red channel.
-
gColour= <MagicMock name='mock.Colour()' id='4116519520'>¶ Colour to use for the green channel.
-
bColour= <MagicMock name='mock.Colour()' id='4116519520'>¶ Colour to use for the blue channel.
-
suppressR= <MagicMock name='mock.Boolean()' id='4117273880'>¶ Suppress the R channel.
-
suppressG= <MagicMock name='mock.Boolean()' id='4117273880'>¶ Suppress the G channel.
-
suppressB= <MagicMock name='mock.Boolean()' id='4117273880'>¶ Suppress the B channel.
-
suppressA= <MagicMock name='mock.Boolean()' id='4117273880'>¶ Suppress the A channel.
-
suppressMode= <MagicMock name='mock.Choice()' id='4117029600'>¶ How colours should be suppressed.
-
interpolation= <MagicMock name='mock.Choice()' id='4116198904'>¶
-
__init__(overlay, display, overlayList, displayCtx, **kwargs)[source]¶ Create a
VolumeRGBOptsinstance for the specifiedoverlay, assumed to be anImageinstance with typeNIFTI_TYPE_RGB24orNIFTI_TYPE_RGBA32.All arguments are passed through to the
DisplayOptsconstructor.
-
__module__= 'fsleyes.displaycontext.volumeopts'¶
-
-
class
fsleyes.displaycontext.volumeopts.ComplexOpts(*args, **kwargs)[source]¶ Bases:
fsleyes.displaycontext.volumeopts.VolumeOptsThe
ComplexOptsclass is a specialisation ofVolumeOptsfor images with a complex data type.-
__module__= 'fsleyes.displaycontext.volumeopts'¶
-
component= <MagicMock name='mock.Choice()' id='4117029600'>¶ 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 theVolumeOptsconstructor.
-
getDataRange()[source]¶ Overrides
ColourMapOpts.getDataRange(). Calculates and returns the data range of the currentcomponent.
-
getComponent(data)[source]¶ Calculates and returns the current
componentfrom the given data, assumed to be complex.
-
__componentChanged(*a)¶ Called when the
componentchanges. CallsColourMapOpts.updateDataRange().
-