genre DTIImageProcessing
authors Mathias Schlüter, Jan Klein
package FMEwork/Release
definition MLDTI.def
see also DiffusionTensorAnalysis
keywords DTI, vector, color, coding


The module VectorToColor provides for a visualization of vector fields by color maps.


Connect an input image with vector components encoded in the u-dimension to the input.

Select a color coding scheme from Color Coding. If Direction User is chosen, enter a projection plane in the Projection Plane text field.

The output contains the color coded image with color components in the c-dimension.


The vector fields are assumed to have antipodal symmetry. That means the two vectors v and -v convey the same information.

Furthermore the vectors are assumed to be inside the unit sphere. Thus the vector components are scaled from [minVoxelValueIn, maxVoxelValueIn] to [-1, 1] before they are transformed to colors.


Default Panel


Input Fields


name: input0, type: Image

The input has to encode the vector components in the u-dimension.

Output Fields


name: output0, type: Image

The output image has one c-component if Color Coding is set to Direction Off and three c-components otherwise.

If the alpha channel is enabled, the output image has four c-components.

The output data type is float in all cases.

Parameter Fields

Field Index

Alpha Channel: Bool
apply: Trigger
autoApply: Bool
Color Coding: Enum
Contrast: Double
Projection Plane: String

Visible Fields

Color Coding

name: colorCodeMode, type: Enum, default: DirectionAxial

Defines the color coding mode.

For modes other than Direction Off and Direction Absolute, the mode does the following.

Vectors are color coded with respect to a projection plane. The length of the vectors defines the lightness of the corresponding colors. The projection of the normalized vectors onto the projection plane is used for the definition of hue and saturation of the corresponding colors: Orientation and length of the projection define hue and saturation, respectively. The projection plane is either axial, coronal, sagittal or user defined according to the selections given above. For a detailed description of this “unique planar color coding” see

[M. Schlueter et al.] Unique Planar color coding of fiber bundles and its application to fiber integrity quantification, Proc. of ISBI 2004, pages 900-903, 2004

Note that the user defined color mode allows for detecting wrong gradient schemes and for finding out a possible flip of the x-, y-, or z-component (see the module DiffusionTensorAnalysis). The leftmost image shows a color-coding, where a correct gradient scheme has been used. If the color coding looks like one of the other images, use the appropriate flip denoted below to turn the scheme into a correct one so that it looks like the left image.



Title Name Description
Off DirectionOff The length of the input vectors is coded in a gray scale.
Absolute DirectionAbsolute

The absolute values of the first three vector components are taken as RGB values.

The RGB values at the output are normalized by their maximum and multiplied by the length of the vector.

Axial DirectionAxial  
Coronal DirectionCoronal  
Sagittal DirectionSagittal  
User DirectionUser  

Projection Plane

name: projectionPlane, type: String, default: 1  1  0,  0  1  1,

If Color Coding is set to Direction User, an arbitrary projection plane can be defined in the text field by entering two vectors, where vector components are separated by blanks. Missing components are interpreted as zero. If all vectors are zero, the axial projection plane is used for color coding.


name: contrast, type: Double, default: 1, minimum: 0, maximum: 1

Sets a modification value for the contrast.

Alpha Channel

name: alphaChannel, type: Bool, default: FALSE

If checked, alpha channel is used if you do not would like to scale the color values automatically by the lengths of the vectors.

Then, the lengths will be stored in a separate alpha channel so that the c-dimension of the output image will be increased by one.

Hidden Fields


name: autoApply, type: Bool, default: TRUE


name: apply, type: Trigger