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)

Bases: fsleyes.displaycontext.niftiopts.NiftiOpts

The VectorOpts class is the base class for LineVectorOpts, RGBVectorOpts, TensorOpts, and SHOpts. 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 and sh overlays.

xColour = <MagicMock name='mock.Colour()' id='140735848816272'>

Colour used to represent the X vector magnitude.

yColour = <MagicMock name='mock.Colour()' id='140735848816272'>

Colour used to represent the Y vector magnitude.

zColour = <MagicMock name='mock.Colour()' id='140735848816272'>

Colour used to represent the Z vector magnitude.

suppressX = <MagicMock name='mock.Boolean()' id='140735851538640'>

Do not use the X vector magnitude to colour vectors.

suppressY = <MagicMock name='mock.Boolean()' id='140735851538640'>

Do not use the Y vector magnitude to colour vectors.

suppressZ = <MagicMock name='mock.Boolean()' id='140735851538640'>

Do not use the Z vector magnitude to colour vectors.

suppressMode = <MagicMock name='mock.Choice()' id='140735848912272'>

How vector direction colours should be suppressed.

cmap = <MagicMock name='mock.ColourMap()' id='140735845712656'>

If an image is selected as the colourImage, this colour map is used to colour the vector voxels.

colourImage = <MagicMock name='mock.Choice()' id='140735848912272'>

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 modulation. If a colourImage is selected, the xColour, yColour, zColour, suppressX, suppressY, and suppressZ properties are all ignored.

modulateImage = <MagicMock name='mock.Choice()' id='140735848912272'>

Modulate the vector colour brightness 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.

clipImage = <MagicMock name='mock.Choice()' id='140735848912272'>

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. The clippingRange dictates the value below which vector voxels are clipped.

clippingRange = <MagicMock name='mock.Bounds()' id='140735846157520'>

Hide voxels for which the clipImage value is outside of this range.

modulateRange = <MagicMock name='mock.Bounds()' id='140735846157520'>

Data range used in brightness modulation, when a modulateImage is in use.

__init__(image, *args, **kwargs)

Create a VectorOpts instance for the given image. All arguments are passed through to the NiftiOpts constructor.

orientFlip = <MagicMock name='mock.Boolean()' id='140735851538640'>

If True, individual vectors are flipped along the x-axis. This property is only applicable to the LineVectorOpts, TensorOpts, and SHOpts classes. See the NiftiOpts.getTransform() method for more information.

This value defaults to True for images which have a neurological storage order, and False for radiological images.

_VectorOpts__clipImageChanged(*a)

Called when the clipImage property changes. Updates the range of the clippingRange property.

_VectorOpts__modulateImageChanged(*a)

Called when the modulateImage property changes. Updates the range of the modulateRange property.

_VectorOpts__overlayListChanged(*a)

Called when the overlay list changes. Updates the modulateImage, colourImage and clipImage properties so that they contain a list of overlays which could be used to modulate the vector image.

_VectorOpts__refreshAuxImage(imageName)

Updates the named image property (modulateImage, colourImage or clipImage) so that it contains a list of overlays which could be used to modulate the vector image.

__module__ = 'fsleyes.displaycontext.vectoropts'
destroy()

Removes some property listeners, and calls the NiftiOpts.destroy() method.

class fsleyes.displaycontext.vectoropts.LineVectorOpts(*args, **kwargs)

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.

__module__ = 'fsleyes.displaycontext.vectoropts'
lineWidth = <MagicMock name='mock.Real()' id='140735894843600'>

Width of the line in pixels.

directed = <MagicMock name='mock.Boolean()' id='140735851538640'>

If True, the vector data is interpreted as directed. Otherwise, the vector data is assumed to be undirected.

unitLength = <MagicMock name='mock.Boolean()' id='140735851538640'>

If True, each vector is scaled so that it has a length of 1 * lengthScale (or 0.5 if directed is True).

lengthScale = <MagicMock name='mock.Percentage()' id='140735841619344'>

Length scaling factor.

__init__(*args, **kwargs)

Create a LineVectorOpts instance. All arguments are passed through to the VectorOpts constructor.

class fsleyes.displaycontext.vectoropts.RGBVectorOpts(*args, **kwargs)

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.

__module__ = 'fsleyes.displaycontext.vectoropts'
interpolation = <MagicMock name='mock.Choice()' id='140735845742096'>
__init__(*args, **kwargs)

Create a RGBVectorOpts instance. All arguments are passed through to the VectorOpts constructor.