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.NiftiOpts
The
VectorOpts
class is the base class forLineVectorOpts
,RGBVectorOpts
,TensorOpts
, andSHOpts
. It contains display settings which are common to each of them.A note on orientation
The
orientFlip
property 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
tensor
andsh
overlays.- xColour = <MagicMock name='mock.Colour()' id='140112348024448'>
Colour used to represent the X vector magnitude.
- yColour = <MagicMock name='mock.Colour()' id='140112348024448'>
Colour used to represent the Y vector magnitude.
- zColour = <MagicMock name='mock.Colour()' id='140112348024448'>
Colour used to represent the Z vector magnitude.
- suppressX = <MagicMock name='mock.Boolean()' id='140112348499920'>
Do not use the X vector magnitude to colour vectors.
- suppressY = <MagicMock name='mock.Boolean()' id='140112348499920'>
Do not use the Y vector magnitude to colour vectors.
- suppressZ = <MagicMock name='mock.Boolean()' id='140112348499920'>
Do not use the Z vector magnitude to colour vectors.
- suppressMode = <MagicMock name='mock.Choice()' id='140112346301776'>
How vector direction colours should be suppressed.
- cmap = <MagicMock name='mock.ColourMap()' id='140112346490352'>
If an image is selected as the
colourImage
, this colour map is used to colour the vector voxels.
- colourImage = <MagicMock name='mock.Choice()' id='140112346301776'>
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 acolourImage
is selected, thexColour
,yColour
,zColour
,suppressX
,suppressY
, andsuppressZ
properties are all ignored.
- modulateImage = <MagicMock name='mock.Choice()' id='140112346301776'>
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='140112346301776'>
Modulate either the brightness or transparency bu the modulation image.
- clipImage = <MagicMock name='mock.Choice()' id='140112346301776'>
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. TheclippingRange
dictates the value below which vector voxels are clipped.
- clippingRange = <MagicMock name='mock.Bounds()' id='140112347388352'>
Hide voxels for which the
clipImage
value is outside of this range.
- modulateRange = <MagicMock name='mock.Bounds()' id='140112347388352'>
Data range used in brightness/transparency modulation, when a
modulateImage
is in use.
- __init__(image, *args, **kwargs)[source]
Create a
VectorOpts
instance for the given image. All arguments are passed through to theNiftiOpts
constructor.
- orientFlip = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, individual vectors are flipped along the x-axis. This property is only applicable to theLineVectorOpts
,TensorOpts
, andSHOpts
classes. See theNiftiOpts.getTransform()
method for more information.This value defaults to
True
for images which have a neurological storage order, andFalse
for radiological images.
- __annotations__ = {}
- __module__ = 'fsleyes.displaycontext.vectoropts'
- destroy()[source]
Removes some property listeners, and calls the
NiftiOpts.destroy()
method.
- __clipImageChanged(*a)
Called when the
clipImage
property changes. Updates the range of theclippingRange
property.
- __modulateImageChanged(*a)
Called when the
modulateImage
property changes. Updates the range of themodulateRange
property.
- __overlayListChanged(*a)
Called when the overlay list changes. Updates the
modulateImage
,colourImage
andclipImage
properties 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
,colourImage
orclipImage
) 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.VectorOpts
The
LineVectorOpts
class contains settings for displaying vector images, using a line to represent the vector value at each voxel.- __annotations__ = {}
- __module__ = 'fsleyes.displaycontext.vectoropts'
- lineWidth = <MagicMock name='mock.Real()' id='140112346269392'>
Width of the line in pixels.
- directed = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, the vector data is interpreted as directed. Otherwise, the vector data is assumed to be undirected.
- unitLength = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, each vector is scaled so that it has a length of1 * lengthScale
(or 0.5 ifdirected
isTrue
).
- lengthScale = <MagicMock name='mock.Percentage()' id='140112347290672'>
Length scaling factor.
- __init__(*args, **kwargs)[source]
Create a
LineVectorOpts
instance. All arguments are passed through to theVectorOpts
constructor.
- class fsleyes.displaycontext.vectoropts.RGBVectorOpts(*args, **kwargs)[source]
Bases:
fsleyes.displaycontext.vectoropts.VectorOpts
The
RGBVectorOpts
class contains settings for displaying vector images, using a combination of three colours to represent the vector value at each voxel.- __annotations__ = {}
- __module__ = 'fsleyes.displaycontext.vectoropts'
- interpolation = <MagicMock name='mock.Choice()' id='140112346946176'>
Apply interpolation to the image data.
- unitLength = <MagicMock name='mock.Boolean()' id='140112348499920'>
If
True
, the vector data is scaled so it has length 1.
- __init__(*args, **kwargs)[source]
Create a
RGBVectorOpts
instance. All arguments are passed through to theVectorOpts
constructor.