Groupwise registration using DTI-TK

From CMIC
Revision as of 12:47, 25 August 2015 by Mmodat (Talk | contribs)

Jump to: navigation, search

The python script to run a groupwise of diffusion tensor image (DTI) is perform_dti_groupwise.py

To generate tensor images from the diffusion MRI data, see the DTI pre-processing page.

The script help is the following:

usage: perform_dti_groupwise.py [-h]
                                [--input_dir input_dir | --input_img input_img [input_img ...]]
                                [--rigid_it number] [--affine_it number]
                                [--nonrigid_it number] -o output_dir [-g]

Groupwise registration for DTI images

optional arguments:
  -h, --help            show this help message and exit
  --input_dir input_dir
                        Input directory containing the Nifti file(s) to
                        include in the processing
  --input_img input_img [input_img ...]
                        List of Nifti file(s) to include in the processing
  --rigid_it number     Number of iteration to perform for the rigid step
                        (default is 3)
  --affine_it number    Number of iteration to perform for the affine step
                        (default is 3)
  --nonrigid_it number  Number of iteration to perform for the nonrigid step
                        (default is 6)
  -o output_dir, --output_dir output_dir
                        Output directory where to save the results
  -g, --graph           Print a graph describing the node connections and exit

As an input, the script expects several DTI images, e.g. /folder/DTI_img0.nii.gz, /folder/DTI_img1.nii.gz, ..., /folder/DTI_imgN.nii.gz and can be run as:

python perform_dti_groupwise.py \
   --input_img /folder/DTI_img0.nii.gz /folder/DTI_img1.nii.gz [...] /folder/DTI_imgN.nii.gz

Alternatively, one can only specify the folder containing all the input images, e.g.:

python perform_dti_groupwise.py --input_dir /folder

in which case all the image files (analyze and nifti) in /folder will be considered.

By default the output of the script will be written in the current directory, the use can specify the output directory by using the --output_dir option, e.g.:

python perform_dti_groupwise.py --input_dir /folder --output_dir /output_directory

The number of iteration for the rigid, affine and non-rigid steps are 3, 3 and 6 respectively as recommended in DTITK. This can be altered using the --rigid_it, --affine_it and --nonrigid_it arguments, e.g.:

python perform_dti_groupwise.py \
   --input_dir /folder \
   --output_dir /output_directory \
   --rigid_it 1 --affine_it 1 --nonlinear_it 1

Note that the sum of rigid and affine iteration can not be equal to zero.

The outputs of the script are the following:

  • An average template image called: dtitk_groupwise_template.nii.gz
  • For every input image, name for example with the following pattern DTI_filename.nii.gz:
    • the input image rescaled to be used by dtitk: DTI_filename_scaled.nii.gz
    • the scale image warped to the template space: DTI_filename_warped.nii.gz
    • the transformation use to resample the scale image to the template space: DTI_filename_trans.nii.gz (or DTI_filename_trans.aff if the number of nonlinear iteration is set to zero)