Difference between revisions of "Groupwise registration using DTI-TK"
(Created page with " The python script to run a groupwise of diffusion MR image is <code>perform_dti_groupwise.py</code> The script help is the following: <pre> usage: perform_dti_groupwise.py [...") |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | The python script to run a groupwise of diffusion | + | The python script to run a groupwise of diffusion tensor image (DTI) is <code>perform_dti_groupwise.py</code> |
+ | To use this script [[Prerequisite DTI-TK | DTI-TK has to be installed]] | ||
+ | |||
+ | To generate tensor images from the diffusion MRI data, see the [[DTI pre-processing]] page. | ||
The script help is the following: | The script help is the following: | ||
Line 30: | Line 33: | ||
As an input, the script expects several DTI images, e.g. <code>/folder/DTI_img0.nii.gz</code>, <code>/folder/DTI_img1.nii.gz</code>, ..., <code>/folder/DTI_imgN.nii.gz</code> and can be run as: | As an input, the script expects several DTI images, e.g. <code>/folder/DTI_img0.nii.gz</code>, <code>/folder/DTI_img1.nii.gz</code>, ..., <code>/folder/DTI_imgN.nii.gz</code> and can be run as: | ||
− | <pre>perform_dti_groupwise.py --input_img /folder/DTI_img0.nii.gz /folder/DTI_img1.nii.gz [...] /folder/DTI_imgN.nii.gz</pre> | + | <pre> |
+ | python perform_dti_groupwise.py \ | ||
+ | --input_img /folder/DTI_img0.nii.gz /folder/DTI_img1.nii.gz [...] /folder/DTI_imgN.nii.gz | ||
+ | </pre> | ||
Alternatively, one can only specify the folder containing all the input images, e.g.: | Alternatively, one can only specify the folder containing all the input images, e.g.: | ||
− | <pre>perform_dti_groupwise.py --input_dir /folder</pre> | + | <pre>python perform_dti_groupwise.py --input_dir /folder</pre> |
− | in which case all the image | + | in which case all the image files (analyze and nifti) in <code>/folder</code> 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 <code>--output_dir</code> option, e.g.: | By default the output of the script will be written in the current directory, the use can specify the output directory by using the <code>--output_dir</code> option, e.g.: | ||
− | <pre>perform_dti_groupwise.py --input_dir /folder --output_dir /output_directory</pre> | + | <pre>python perform_dti_groupwise.py --input_dir /folder --output_dir /output_directory</pre> |
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 <code>--rigid_it</code>, <code>--affine_it</code> and <code>--nonrigid_it</code> arguments, e.g.: | 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 <code>--rigid_it</code>, <code>--affine_it</code> and <code>--nonrigid_it</code> arguments, e.g.: | ||
− | <pre>perform_dti_groupwise.py --input_dir /folder --output_dir /output_directory --rigid_it 1 --affine_it 1 --nonlinear_it 1</pre> | + | <pre> |
+ | python perform_dti_groupwise.py \ | ||
+ | --input_dir /folder \ | ||
+ | --output_dir /output_directory \ | ||
+ | --rigid_it 1 --affine_it 1 --nonlinear_it 1 | ||
+ | </pre> | ||
Note that the sum of rigid and affine iteration can not be equal to zero. | Note that the sum of rigid and affine iteration can not be equal to zero. | ||
The outputs of the script are the following: | The outputs of the script are the following: | ||
* An average template image called: <code>dtitk_groupwise_template.nii.gz</code> | * An average template image called: <code>dtitk_groupwise_template.nii.gz</code> | ||
− | * For every input image <code>DTI_filename.nii.gz</code>: | + | * For every input image, name for example with the following pattern <code>DTI_filename.nii.gz</code>: |
** the input image rescaled to be used by dtitk: <code>DTI_filename_scaled.nii.gz</code> | ** the input image rescaled to be used by dtitk: <code>DTI_filename_scaled.nii.gz</code> | ||
** the scale image warped to the template space: <code>DTI_filename_warped.nii.gz</code> | ** the scale image warped to the template space: <code>DTI_filename_warped.nii.gz</code> | ||
** the transformation use to resample the scale image to the template space: <code>DTI_filename_trans.nii.gz</code> (or <code>DTI_filename_trans.aff</code> if the number of nonlinear iteration is set to zero) | ** the transformation use to resample the scale image to the template space: <code>DTI_filename_trans.nii.gz</code> (or <code>DTI_filename_trans.aff</code> if the number of nonlinear iteration is set to zero) |
Latest revision as of 12:49, 25 August 2015
The python script to run a groupwise of diffusion tensor image (DTI) is perform_dti_groupwise.py
To use this script DTI-TK has to be installed
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
(orDTI_filename_trans.aff
if the number of nonlinear iteration is set to zero)
- the input image rescaled to be used by dtitk: