Content-type: text/html
This program provides a command line method to get an RGB color-coded image similar to the one displayed in pdview. The RGB color triplet for each pixel comes from the absolute value of the specified eigenvector (for tensor eigensystem or PICo data) or the spherical function peak direction (for PAS / QBall data), so:
|x| = r
|y| = g
|z| = b
Each color channel is scaled by a scalar value. For tensor data, the default scalar is fractional anisotropy, so the scaling is naturally between 0 and 1. If another scalar image is used, the intensities are normalized and then used to scale the RGB data. When reading the output of sfpeaks, the default scalar is the trace of the Hessian of the strongest peak. The user may pass any scalar image that has identical dimensions to the diffusion data. The scalar multiplication is applied after the RGB is calculated and RGB gamma correction is applied, thus if you pass -rgbgamma 0.0 the output is greyscale and the contrast is the same as the scalar image.
If the scalar file passed to the program is an image header, the voxel and data dimensions are read from the header and the -voxeldims and -datadims arguments can be omitted.
The output is either in NIfTI, MetaImage (ITK) or VTK format. The output may be visualized in ITK SNAP.
Because of inconsistent RGB support in various programs (notably Paraview, which won't read RGB NIfTI), you may output the image in a different format from the input image, and for this reason you should specify -outputfile and not the usual -outputroot. If you change formats, there is no guarantee that the voxel to physical transform of the image will be properly translated.
Get the RGB map modulated by FA from tensor data.
dteig < tensors.Bdouble | rgbscalarimg -datadims 128 128 60 -voxeldims 1.7 1.7 2.3 -outputfile rgb.mha
The same thing, but using precomputed scalar data.
rgbscalarimg -scalarfile fa.nii -outputfile rgb.nii -inputfile dt_eig_sys.Bdouble
The same thing, but output the RGB map for e2, the second eigenvector
rgbscalarimg -scalarfile fa.nii -outputfile rgb_e2.nii -inputfile dt_eig_sys.Bdouble -e2
Output an MHA image from NIfTI input (dangerous - may lead to incorrect transforms in the header)
rgbscalarimg -scalarfile fa.nii -outputfile rgb.mha -inputfile dt_eig_sys.Bdouble
-datadims <x> <y> <z> The dimensions of the image, in voxels.
If a binary file is specified, then the data type should be the same as the input data, which is double unless otherwise specified with the (-inputdatatype) option.
Whichever kind of scalar file is used, it should be defined in the same space as the diffusion data.
If no scalar file is given, the default is fractional anisotropy (tensor eigen system data) or Hessian trace (spherical function peaks).
No alpha support for VTK or MetaIO output.