NAME
minctensor.pl - script to run dti.m: calculates mean diffusivity (MD), fractional anisotropy (FA), eigenvectors and eigenvalues of diffusion tensor in each voxel of a minc file
SYNOPSIS
minctensor.pl [<options>] <infile>
DESCRIPTION
Minctensor will call
dti.m
, which runs in matlab, using niak and minc utilities (we moved away from using the emma tools, due to compilation issues across different platforms). There are some other programs that get called:duplicate_frame
,matlab_cmdline
to call matlab from the shell,rgbvector
(to make rgb files for visualization usingDisplay
). This program computes the diffusion tensor in each voxel of the 4D input file (see specs below). The outputs are the following 3D volumes:infile_FA.mnc : fractional anisotropy map infile_MD.mnc : mean diffusivity map infile_e1x,_e1y,_e1z : principal eigenvector component in the x,y and z directions infile_e2x,_e2y,_e2z,_e3x,_e3y,_e3z : other 2 eigenvector components in the x,y and z directions infile_lambda1,_lambda2,_lambda3 : eigenvalue maps of the 3 vector components
INPUT FILE
The input file is a 4D volume, with the different diffusion directions in the time dimension. For example, for an acquisition with 10 b=0 images, 99 directions, 128 square matrix and 63 slices, the input volume should be 128x128x63x109 (xspace x yspace x zspace x time). The directions should already be in the minc header (check
mincheader dti.mnc | grep direction
) but if they are not there, you can use the script minc_modify_header-diff.
OPTIONS
Script to run dti.m: calculates mean diffusivity, FA, eigenvectors and eigenvalues of diffusion tensor Usage: minctensor.pl [options] < input.mnc> [output base] input: minc file with b values in time dimension output: by default, output filenames are based on the input filename, use 'output base' option for arbitrary output name and directory -help for options will resample everything to transverse images!!! to use this script, you will need: mincinfo, mincreshape, mincconcat, matlab or octave, Summary of options: -clobber clobber all output files -noclobber opposite of -clobber [default] -sigma standard deviation of the noise in the image (sigma=mean intensity in noise * sqrt(2/pi)). If this option is not given or is 0, no chisquare map will be produced. [default: 0] -mask mask file: tensor will not be calculated where mask file value is 0 [default: ""] -outputdir output directory (use this OR 'output base' option) [default: ""] -octave Use octave -nooctave opposite of -octave -verbose Be verbose -noverbose opposite of -verbose [default] -niak Run NIAK version [default](always used for octave) -noniak opposite of -niak -niakdir Specify NIAK directory (-niak option is set on) [default: ""] -split Split input into subsets to avoid memory problems in matlab -nosplit opposite of -split [default]
NOTES
- By default, the code uses the NIAK toolbox to interface between minc and matlab. You will need to install it. You must specify the location of the installation if it's not already in your matlab path. Your matlab path can be set-up by creating/modifying a startup.m file in a folder called matlab in your home directory (check here for more tips).
- The code will callmatlab
. If it does not exist under this name on your system, make sure to create a symbolic link to it. NOTE: You MUST create a symbolic link, an alias does not seem to work!
- If you do not have matlab, it is also possible to use Octave, which is free software.
EXAMPLES
NOTE: It's always a good idea to make sure that your diffusion directions were entered CORRECTLY (especially before you do any fibertracking), please refer to the minc3Dvis manpage on how to do this.If you want to process all the voxels in the volume or if your data is already masked (tensor will be calculated in all voxels > 0). If you want the outputs to have basename 'out' (e.g. out_FA.mnc, etc.):
minctensor.pl dti-masked.mnc -niakdir /path/to/installation outIf you have a separate binary brain mask (such as the one created by mincbet through diff_preprocess). If you want the outputs to be created in '/tmp' with a basename matching that of the input file (e.g. /tmp/dti-reg-to-t1_FA.mnc, etc.):
minctensor.pl -mask anat-n3-bet_mask.mnc dti-reg-to-t1.mnc -niakdir /path/to/installation -outputdir /tmp/If you don't have matlab and have installed octave:
minctensor.pl -mask anat-n3-bet_mask.mnc dti-reg-to-t1.mnc -niakdir /path/to/installation -octave out