cmtklib.interfaces.diffusion_toolkit module

The Diffusion Toolkit module provides Nipype interfaces for the Diffusion Toolkit missing in nipype or modified.

DTIRecon

Link to code

Bases: nipype.interfaces.base.core.CommandLine

Wrapped executable: dti_recon.

Use dti_recon to generate tensors and other maps.

Note

Not used anymore by CMP3

DWIa pathlike object or string representing an existing file

Input diffusion volume. Maps to a command-line argument: %s (position: 1).

gradient_matrixa pathlike object or string representing an existing file

Specify gradient matrix to use. required. Maps to a command-line argument: -gm %s (position: 3).

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

b0_thresholda float
Program will use b0 image with the given threshold to mask out high

background of fa/adc maps. by default it will calculate threshold automatically. but if it failed, you need to set it manually.

Maps to a command-line argument: -b0_th.

b_valuean integer

Set b value or maximum b value for multi-bvalue data. default is 1000. Maps to a command-line argument: -b %d.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

image_orientation_vectorsa list of from 6 to 6 items which are a float
Specify image orientation vectors. if just one argument given,

will treat it as filename and read the orientation vectors from the file. if 6 arguments are given, will treat them as 6 float numbers and construct the 1st and 2nd vector and calculate the 3rd one automatically. this information will be used to determine image orientation, as well as to adjust gradient vectors with oblique angle when.

Maps to a command-line argument: -iop %f.

multiple_b_valuesa boolean
If ‘MultiBvalue’ is ‘true’

or 1, it will either use the bvalues specified as the 4th component of each gradient vector, or use max b value scaled by the magnitude of the vector.

Maps to a command-line argument: %d (position: 4).

n_averagesan integer

Number of averages. Maps to a command-line argument: -nex %s.

number_of_b0an integer
Number of repeated b0 images on top. default is 1. the program

assumes b0 images are on top.

Maps to a command-line argument: -b0 %d.

oblique_correctiona boolean
When oblique angle(s) applied, some SIEMENS dti protocols do not

adjust gradient accordingly, thus it requires adjustment for correct diffusion tensor calculation.

Maps to a command-line argument: -oc.

out_prefixa string

Output file prefix. Maps to a command-line argument: %s (position: 2). (Nipype default value: dti)

output_type‘nii’ or ‘analyze’ or ‘ni1’ or ‘nii.gz’

Output file type. Maps to a command-line argument: -ot %s. (Nipype default value: nii)

ADC : a pathlike object or string representing an existing file B0 : a pathlike object or string representing an existing file DWI : a pathlike object or string representing an existing file FA : a pathlike object or string representing an existing file FA_color : a pathlike object or string representing an existing file L1 : a pathlike object or string representing an existing file L2 : a pathlike object or string representing an existing file L3 : a pathlike object or string representing an existing file V1 : a pathlike object or string representing an existing file V2 : a pathlike object or string representing an existing file V3 : a pathlike object or string representing an existing file exp : a pathlike object or string representing an existing file tensor : a pathlike object or string representing an existing file

DiffUnpack

Link to code

Bases: nipype.interfaces.base.core.CommandLine

Wrapped executable: diff_unpack.

Use diff_unpack to convert dicom files to multiple formats.

Examples

>>> convert = DiffUnpack()
>>> convert.inputs.input_dicom = '/path/to/sub-01_dwi.dcm'
>>> convert.inputs.out_prefix = 'output'
>>> convert.inputs.output_type = 'nii.gz'
>>> convert.run() 
input_dicoma pathlike object or string representing an existing file

Input dicom file. Maps to a command-line argument: %s (position: 1).

argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

out_prefixa string

Output file prefix. Maps to a command-line argument: %s (position: 2). (Nipype default value: output)

output_type‘nii’ or ‘analyze’ or ‘ni1’ or ‘nii.gz’

Output file type. Maps to a command-line argument: -ot %s. (Nipype default value: nii)

splita boolean
Instead of saving everything in one big multi-timepoint 4D image,

split it into seperate files, one timepoint per file.

Maps to a command-line argument: -split.

converted_filesa list of items which are any value

Converted files.

HARDIMat

Link to code

Bases: nipype.interfaces.base.core.CommandLine

Wrapped executable: hardi_mat.

Use hardi_mat to calculate a reconstruction matrix from a gradient table.

Examples

>>> hardi_mat = HARDIMat()
>>> hardi_mat.inputs.bvecs = 'sub-01_dwi.bvec'
>>> hardi_mat.inputs.bvals = 'sub-01_dwi.bval'
>>> hardi_mat.inputs.gradient_table = 'sub-01_grad.txt'
>>> hardi_mat.inputs.out_file = 'recon_mat.dat'
>>> hardi_mat.inputs.order = 8
>>> hardi_mat.inputs.reference_file = 'sub-01_dwi.nii.gz'
>>> hardi_mat.run() 
argsa string

Additional parameters to the command. Maps to a command-line argument: %s.

bvalsa pathlike object or string representing an existing file

B values file.

bvecsa pathlike object or string representing an existing file

B vectors file. Maps to a command-line argument: %s (position: 1).

environa dictionary with keys which are a bytes or None or a value of class ‘str’ and with values which are a bytes or None or a value of class ‘str’

Environment variables. (Nipype default value: {})

gradient_tablea pathlike object or string representing an existing file

Input gradient table. Maps to a command-line argument: %s (position: 1).

image_infoa pathlike object or string representing an existing file
Specify image information file. the image info file is generated

from original dicom image by diff_unpack program and contains image orientation and other information needed for reconstruction and tracking. by default will look into the image folder for .info file.

Maps to a command-line argument: -info %s.

image_orientation_vectorsa list of from 6 to 6 items which are a float
Specify image orientation vectors. if just one argument given,

will treat it as filename and read the orientation vectors from the file. if 6 arguments are given, will treat them as 6 float numbers and construct the 1st and 2nd vector and calculate the 3rd one automatically. This information will be used to determine image orientation, as well as to adjust gradient vectors with oblique angle when.

Maps to a command-line argument: -iop %f.

oblique_correctiona boolean
When oblique angle(s) applied, some SIEMENS dti

protocols do not adjust gradient accordingly, thus it requires adjustment for correct diffusion tensor calculation.

Maps to a command-line argument: -oc.

odf_filea pathlike object or string representing an existing file
Filename that contains the reconstruction points on a HEMI-sphere.

use the pre-set 181 points by default.

Maps to a command-line argument: -odf %s.

orderan integer
Maximum order of spherical harmonics. must be even number. default

is 4.

out_filea pathlike object or string representing a file

Output matrix file. Maps to a command-line argument: %s (position: 2). (Nipype default value: recon_mat.dat)

reference_filea pathlike object or string representing an existing file
Provide a dicom or nifti image as the reference for the program to

figure out the image orientation information. if no such info was found in the given image header, the next 5 options -info, etc., will be used if provided. if image orientation info can be found in the given reference, all other 5 image orientation options will be IGNORED.

Maps to a command-line argument: -ref %s.

out_filea pathlike object or string representing an existing file

Output matrix file.