fsleyes.displaycontext.vectoropts¶
This module provides the VectorOpts, LineVectorOpts, and
RGBVectorOpts classes, which contain options for displaying NIFTI
vector images.
-
class
fsleyes.displaycontext.vectoropts.VectorOpts(image, *args, **kwargs)[source]¶ Bases:
fsleyes.displaycontext.niftiopts.NiftiOptsThe
VectorOptsclass is the base class forLineVectorOpts,RGBVectorOpts,TensorOpts, andSHOpts. It contains display settings which are common to each of them.A note on orientation
The
orientFlipproperty allows you to flip the left-right orientation of line vectors, tensors, and SH functions. This option is necessary, because different tools may output vector data in different ways, depending on the image orientation.For images which are stored radiologically (with the X axis increasaing from right to left), the FSL tools (e.g. dtifit) will generate vectors which are oriented according to the voxel coordinate system. However, for neurologically stored images (X axis increasing from left to right), FSL tools generate vectors which are radiologically oriented, and thus are inverted with respect to the X axis in the voxel coordinate system. Therefore, in order to correctly display vectors from such an image, we must flip each vector about the X axis.
This issue is also applicable to
tensorandshoverlays.-
xColour= <MagicMock name='mock.Colour()' id='4116519520'>¶ Colour used to represent the X vector magnitude.
-
yColour= <MagicMock name='mock.Colour()' id='4116519520'>¶ Colour used to represent the Y vector magnitude.
-
zColour= <MagicMock name='mock.Colour()' id='4116519520'>¶ Colour used to represent the Z vector magnitude.
-
suppressX= <MagicMock name='mock.Boolean()' id='4117273880'>¶ Do not use the X vector magnitude to colour vectors.
-
suppressY= <MagicMock name='mock.Boolean()' id='4117273880'>¶ Do not use the Y vector magnitude to colour vectors.
-
suppressZ= <MagicMock name='mock.Boolean()' id='4117273880'>¶ Do not use the Z vector magnitude to colour vectors.
-
suppressMode= <MagicMock name='mock.Choice()' id='4117029600'>¶ How vector direction colours should be suppressed.
-
cmap= <MagicMock name='mock.ColourMap()' id='4116140696'>¶ If an image is selected as the
colourImage, this colour map is used to colour the vector voxels.
-
colourImage= <MagicMock name='mock.Choice()' id='4117029600'>¶ Colour vector voxels by the values contained in this image. Any image which is in the
OverlayList, and which has the same voxel dimensions as the vector image can be selected for colouring. If acolourImageis selected, thexColour,yColour,zColour,suppressX,suppressY, andsuppressZproperties are all ignored.
-
modulateImage= <MagicMock name='mock.Choice()' id='4117029600'>¶ Modulate the vector colour brightness/alpha by another image. Any image which is in the
OverlayList, and which has the same voxel dimensions as the vector image can be selected for modulation.
-
modulateMode= <MagicMock name='mock.Choice()' id='4117029600'>¶ Modulate either the brightness or transparency bu the modulation image.
-
clipImage= <MagicMock name='mock.Choice()' id='4117029600'>¶ Clip voxels from the vector image according to another image. Any image which is in the
OverlayList, and which has the same voxel dimensions as the vector image can be selected for clipping. TheclippingRangedictates the value below which vector voxels are clipped.
-
clippingRange= <MagicMock name='mock.Bounds()' id='4116394552'>¶ Hide voxels for which the
clipImagevalue is outside of this range.
-
modulateRange= <MagicMock name='mock.Bounds()' id='4116394552'>¶ Data range used in brightness/transparency modulation, when a
modulateImageis in use.
-
__init__(image, *args, **kwargs)[source]¶ Create a
VectorOptsinstance for the given image. All arguments are passed through to theNiftiOptsconstructor.
-
orientFlip= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, individual vectors are flipped along the x-axis. This property is only applicable to theLineVectorOpts,TensorOpts, andSHOptsclasses. See theNiftiOpts.getTransform()method for more information.This value defaults to
Truefor images which have a neurological storage order, andFalsefor radiological images.
-
__module__= 'fsleyes.displaycontext.vectoropts'¶
-
destroy()[source]¶ Removes some property listeners, and calls the
NiftiOpts.destroy()method.
-
__clipImageChanged(*a)¶ Called when the
clipImageproperty changes. Updates the range of theclippingRangeproperty.
-
__modulateImageChanged(*a)¶ Called when the
modulateImageproperty changes. Updates the range of themodulateRangeproperty.
-
__overlayListChanged(*a)¶ Called when the overlay list changes. Updates the
modulateImage,colourImageandclipImageproperties so that they contain a list of overlays which could be used to modulate the vector image.
-
__refreshAuxImage(imageName)¶ Updates the named image property (
modulateImage,colourImageorclipImage) so that it contains a list of overlays which could be used to modulate the vector image.
-
-
class
fsleyes.displaycontext.vectoropts.LineVectorOpts(*args, **kwargs)[source]¶ Bases:
fsleyes.displaycontext.vectoropts.VectorOptsThe
LineVectorOptsclass contains settings for displaying vector images, using a line to represent the vector value at each voxel.-
__module__= 'fsleyes.displaycontext.vectoropts'¶
-
lineWidth= <MagicMock name='mock.Real()' id='4116054224'>¶ Width of the line in pixels.
-
directed= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, the vector data is interpreted as directed. Otherwise, the vector data is assumed to be undirected.
-
unitLength= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, each vector is scaled so that it has a length of1 * lengthScale(or 0.5 ifdirectedisTrue).
-
lengthScale= <MagicMock name='mock.Percentage()' id='4116877904'>¶ Length scaling factor.
-
__init__(*args, **kwargs)[source]¶ Create a
LineVectorOptsinstance. All arguments are passed through to theVectorOptsconstructor.
-
-
class
fsleyes.displaycontext.vectoropts.RGBVectorOpts(*args, **kwargs)[source]¶ Bases:
fsleyes.displaycontext.vectoropts.VectorOptsThe
RGBVectorOptsclass contains settings for displaying vector images, using a combination of three colours to represent the vector value at each voxel.-
__module__= 'fsleyes.displaycontext.vectoropts'¶
-
interpolation= <MagicMock name='mock.Choice()' id='4116201848'>¶ Apply interpolation to the image data.
-
unitLength= <MagicMock name='mock.Boolean()' id='4117273880'>¶ If
True, the vector data is scaled so it has length 1.
-
__init__(*args, **kwargs)[source]¶ Create a
RGBVectorOptsinstance. All arguments are passed through to theVectorOptsconstructor.
-