nipype.interfaces.mrtrix.preprocess module

DWI2Tensor

Link to code

Bases: CommandLine

Wrapped executable: dwi2tensor.

Converts diffusion-weighted images to tensor images.

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> dwi2tensor = mrt.DWI2Tensor()
>>> dwi2tensor.inputs.in_file = 'dwi.mif'
>>> dwi2tensor.inputs.encoding_file = 'encoding.txt'
>>> dwi2tensor.cmdline
'dwi2tensor -grad encoding.txt dwi.mif dwi_tensor.mif'
>>> dwi2tensor.run()                                   
in_filea list of items which are a pathlike object or string representing an existing file

Diffusion-weighted images. Maps to a command-line argument: %s (position: -2).

argsa string

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

debuga boolean

Display debugging messages. Maps to a command-line argument: -debug (position: 1).

encoding_filea pathlike object or string representing a file

Encoding file supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units (1000 s/mm^2). See FSL2MRTrix(). Maps to a command-line argument: -grad %s (position: 2).

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: {})

ignore_slice_by_volumea list of from 2 to 2 items which are an integer

Requires two values (i.e. [34 1] for [Slice Volume] Ignores the image slices specified when computing the tensor. Slice here means the z coordinate of the slice to be ignored. Maps to a command-line argument: -ignoreslices %s (position: 2).

ignore_volumesa list of at least 1 items which are an integer

Requires two values (i.e. [2 5 6] for [Volumes] Ignores the image volumes specified when computing the tensor. Maps to a command-line argument: -ignorevolumes %s (position: 2).

maska pathlike object or string representing an existing file

Only perform computation within the specified binary brain mask image. Maps to a command-line argument: -mask %s.

out_filenamea pathlike object or string representing a file

Output tensor filename. Maps to a command-line argument: %s (position: -1).

quieta boolean

Do not display information messages or progress status. Maps to a command-line argument: -quiet (position: 1).

tensora pathlike object or string representing an existing file

Path/name of output diffusion tensor image.

Erode

Link to code

Bases: CommandLine

Wrapped executable: erode.

Erode (or dilates) a mask (i.e. binary) image

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> erode = mrt.Erode()
>>> erode.inputs.in_file = 'mask.mif'
>>> erode.run()                                     
in_filea pathlike object or string representing an existing file

Input mask image to be eroded. Maps to a command-line argument: %s (position: -2).

argsa string

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

debuga boolean

Display debugging messages. Maps to a command-line argument: -debug (position: 1).

dilatea boolean

Perform dilation rather than erosion. Maps to a command-line argument: -dilate (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: {})

number_of_passesan integer

The number of passes (default: 1). Maps to a command-line argument: -npass %s.

out_filenamea pathlike object or string representing a file

Output image filename. Maps to a command-line argument: %s (position: -1).

quieta boolean

Do not display information messages or progress status. Maps to a command-line argument: -quiet (position: 1).

out_filea pathlike object or string representing an existing file

The output image.

GenerateWhiteMatterMask

Link to code

Bases: CommandLine

Wrapped executable: gen_WM_mask.

Generates a white matter probability mask from the DW images.

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> genWM = mrt.GenerateWhiteMatterMask()
>>> genWM.inputs.in_file = 'dwi.mif'
>>> genWM.inputs.encoding_file = 'encoding.txt'
>>> genWM.run()                                     
binary_maska pathlike object or string representing an existing file

Binary brain mask. Maps to a command-line argument: %s (position: -2).

encoding_filea pathlike object or string representing an existing file

Gradient encoding, supplied as a 4xN text file with each line is in the format [ X Y Z b ], where [ X Y Z ] describe the direction of the applied gradient, and b gives the b-value in units (1000 s/mm^2). See FSL2MRTrix. Maps to a command-line argument: -grad %s (position: 1).

in_filea pathlike object or string representing an existing file

Diffusion-weighted images. Maps to a command-line argument: %s (position: -3).

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: {})

noise_level_margina float

Specify the width of the margin on either side of the image to be used to estimate the noise level (default = 10). Maps to a command-line argument: -margin %s.

out_WMProb_filenamea pathlike object or string representing a file

Output WM probability image filename. Maps to a command-line argument: %s (position: -1).

WMprobabilitymapa pathlike object or string representing an existing file

WMprobabilitymap.

MRConvert

Link to code

Bases: CommandLine

Wrapped executable: mrconvert.

Perform conversion between different file types and optionally extract a subset of the input image.

If used correctly, this program can be a very useful workhorse. In addition to converting images between different formats, it can be used to extract specific studies from a data set, extract a specific region of interest, flip the images, or to scale the intensity of the images.

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> mrconvert = mrt.MRConvert()
>>> mrconvert.inputs.in_file = 'dwi_FA.mif'
>>> mrconvert.inputs.out_filename = 'dwi_FA.nii'
>>> mrconvert.run()                                 
in_filea pathlike object or string representing an existing file

Voxel-order data filename. Maps to a command-line argument: %s (position: -2).

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: {})

extension‘mif’ or ‘nii’ or ‘float’ or ‘char’ or ‘short’ or ‘int’ or ‘long’ or ‘double’

“i.e. Bfloat”. Can be “char”, “short”, “int”, “long”, “float” or “double”. (Nipype default value: mif)

extract_at_axis1 or 2 or 3

“Extract data only at the coordinates specified. This option specifies the Axis. Must be used in conjunction with extract_at_coordinate. Maps to a command-line argument: -coord %s (position: 1).

extract_at_coordinatea list of from 1 to 3 items which are a float

“Extract data only at the coordinates specified. This option specifies the coordinates. Must be used in conjunction with extract_at_axis. Three comma-separated numbers giving the size of each voxel in mm. Maps to a command-line argument: %s (position: 2).

layout‘nii’ or ‘float’ or ‘char’ or ‘short’ or ‘int’ or ‘long’ or ‘double’

Specify the layout of the data in memory. The actual layout produced will depend on whether the output image format can support it. Maps to a command-line argument: -output %s (position: 2).

offset_biasa float

Apply offset to the intensity values. Maps to a command-line argument: -scale %d (position: 3).

out_filenamea pathlike object or string representing a file

Output filename. Maps to a command-line argument: %s (position: -1).

output_datatype‘nii’ or ‘float’ or ‘char’ or ‘short’ or ‘int’ or ‘long’ or ‘double’

“i.e. Bfloat”. Can be “char”, “short”, “int”, “long”, “float” or “double”. Maps to a command-line argument: -output %s (position: 2).

prsa boolean

Assume that the DW gradients are specified in the PRS frame (Siemens DICOM only). Maps to a command-line argument: -prs (position: 3).

replace_NaN_with_zeroa boolean

Replace all NaN values with zero. Maps to a command-line argument: -zero (position: 3).

resamplea float

Apply scaling to the intensity values. Maps to a command-line argument: -scale %d (position: 3).

voxel_dimsa list of from 3 to 3 items which are a float

Three comma-separated numbers giving the size of each voxel in mm. Maps to a command-line argument: -vox %s (position: 3).

converteda pathlike object or string representing an existing file

Path/name of 4D volume in voxel order.

MRMultiply

Link to code

Bases: CommandLine

Wrapped executable: mrmult.

Multiplies two images.

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> MRmult = mrt.MRMultiply()
>>> MRmult.inputs.in_files = ['dwi.mif', 'dwi_WMProb.mif']
>>> MRmult.run()                                             
in_filesa list of items which are a pathlike object or string representing an existing file

Input images to be multiplied. Maps to a command-line argument: %s (position: -2).

argsa string

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

debuga boolean

Display debugging messages. Maps to a command-line argument: -debug (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: {})

out_filenamea pathlike object or string representing a file

Output image filename. Maps to a command-line argument: %s (position: -1).

quieta boolean

Do not display information messages or progress status. Maps to a command-line argument: -quiet (position: 1).

out_filea pathlike object or string representing an existing file

The output image of the multiplication.

MRTransform

Link to code

Bases: CommandLine

Wrapped executable: mrtransform.

Apply spatial transformations or reslice images

Example

>>> MRxform = MRTransform()
>>> MRxform.inputs.in_files = 'anat_coreg.mif'
>>> MRxform.run()                                   
in_filesa list of items which are a pathlike object or string representing an existing file

Input images to be transformed. Maps to a command-line argument: %s (position: -2).

argsa string

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

debuga boolean

Display debugging messages. Maps to a command-line argument: -debug (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: {})

flip_xa boolean

Assume the transform is supplied assuming a coordinate system with the x-axis reversed relative to the MRtrix convention (i.e. x increases from right to left). This is required to handle transform matrices produced by FSL’s FLIRT command. This is only used in conjunction with the -reference option. Maps to a command-line argument: -flipx (position: 1).

inverta boolean

Invert the specified transform before using it. Maps to a command-line argument: -inverse (position: 1).

linear_transforma pathlike object or string representing an existing file

Specify a linear transform to apply, in the form of a 3x4 or 4x4 ascii file. Note the standard reverse convention is used, where the transform maps points in the template image to the moving image. Note that the reverse convention is still assumed even if no -template image is supplied. Maps to a command-line argument: -linear %s (position: 1).

out_filenamea pathlike object or string representing a file

Output image. Maps to a command-line argument: %s (position: -1).

quieta boolean

Do not display information messages or progress status. Maps to a command-line argument: -quiet (position: 1).

reference_imagea pathlike object or string representing an existing file

In case the transform supplied maps from the input image onto a reference image, use this option to specify the reference. Note that this implicitly sets the -replace option. Maps to a command-line argument: -reference %s (position: 1).

replace_transforma boolean

Replace the current transform by that specified, rather than applying it to the current transform. Maps to a command-line argument: -replace (position: 1).

template_imagea pathlike object or string representing an existing file

Reslice the input image to match the specified template image. Maps to a command-line argument: -template %s (position: 1).

transformation_filea pathlike object or string representing an existing file

The transform to apply, in the form of a 4x4 ascii file. Maps to a command-line argument: -transform %s (position: 1).

out_filea pathlike object or string representing an existing file

The output image of the transformation.

MRTrixInfo

Link to code

Bases: CommandLine

Wrapped executable: mrinfo.

Prints out relevant header information found in the image specified.

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> MRinfo = mrt.MRTrixInfo()
>>> MRinfo.inputs.in_file = 'dwi.mif'
>>> MRinfo.run()                                    
in_filea pathlike object or string representing an existing file

Input images to be read. Maps to a command-line argument: %s (position: -2).

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: {})

MRTrixViewer

Link to code

Bases: CommandLine

Wrapped executable: mrview.

Loads the input images in the MRTrix Viewer.

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> MRview = mrt.MRTrixViewer()
>>> MRview.inputs.in_files = 'dwi.mif'
>>> MRview.run()                                    
in_filesa list of items which are a pathlike object or string representing an existing file

Input images to be viewed. Maps to a command-line argument: %s (position: -2).

argsa string

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

debuga boolean

Display debugging messages. Maps to a command-line argument: -debug (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: {})

quieta boolean

Do not display information messages or progress status. Maps to a command-line argument: -quiet (position: 1).

MedianFilter3D

Link to code

Bases: CommandLine

Wrapped executable: median3D.

Smooth images using a 3x3x3 median filter.

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> median3d = mrt.MedianFilter3D()
>>> median3d.inputs.in_file = 'mask.mif'
>>> median3d.run()                                  
in_filea pathlike object or string representing an existing file

Input images to be smoothed. Maps to a command-line argument: %s (position: -2).

argsa string

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

debuga boolean

Display debugging messages. Maps to a command-line argument: -debug (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: {})

out_filenamea pathlike object or string representing a file

Output image filename. Maps to a command-line argument: %s (position: -1).

quieta boolean

Do not display information messages or progress status. Maps to a command-line argument: -quiet (position: 1).

out_filea pathlike object or string representing an existing file

The output image.

Tensor2ApparentDiffusion

Link to code

Bases: CommandLine

Wrapped executable: tensor2ADC.

Generates a map of the apparent diffusion coefficient (ADC) in each voxel

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> tensor2ADC = mrt.Tensor2ApparentDiffusion()
>>> tensor2ADC.inputs.in_file = 'dwi_tensor.mif'
>>> tensor2ADC.run()                                
in_filea pathlike object or string representing an existing file

Diffusion tensor image. Maps to a command-line argument: %s (position: -2).

argsa string

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

debuga boolean

Display debugging messages. Maps to a command-line argument: -debug (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: {})

out_filenamea pathlike object or string representing a file

Output Fractional Anisotropy filename. Maps to a command-line argument: %s (position: -1).

quieta boolean

Do not display information messages or progress status. Maps to a command-line argument: -quiet (position: 1).

ADCa pathlike object or string representing an existing file

The output image of the major eigenvectors of the diffusion tensor image.

Tensor2FractionalAnisotropy

Link to code

Bases: CommandLine

Wrapped executable: tensor2FA.

Generates a map of the fractional anisotropy in each voxel.

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> tensor2FA = mrt.Tensor2FractionalAnisotropy()
>>> tensor2FA.inputs.in_file = 'dwi_tensor.mif'
>>> tensor2FA.run()                                 
in_filea pathlike object or string representing an existing file

Diffusion tensor image. Maps to a command-line argument: %s (position: -2).

argsa string

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

debuga boolean

Display debugging messages. Maps to a command-line argument: -debug (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: {})

out_filenamea pathlike object or string representing a file

Output Fractional Anisotropy filename. Maps to a command-line argument: %s (position: -1).

quieta boolean

Do not display information messages or progress status. Maps to a command-line argument: -quiet (position: 1).

FAa pathlike object or string representing an existing file

The output image of the major eigenvectors of the diffusion tensor image.

Tensor2Vector

Link to code

Bases: CommandLine

Wrapped executable: tensor2vector.

Generates a map of the major eigenvectors of the tensors in each voxel.

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> tensor2vector = mrt.Tensor2Vector()
>>> tensor2vector.inputs.in_file = 'dwi_tensor.mif'
>>> tensor2vector.run()                             
in_filea pathlike object or string representing an existing file

Diffusion tensor image. Maps to a command-line argument: %s (position: -2).

argsa string

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

debuga boolean

Display debugging messages. Maps to a command-line argument: -debug (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: {})

out_filenamea pathlike object or string representing a file

Output vector filename. Maps to a command-line argument: %s (position: -1).

quieta boolean

Do not display information messages or progress status. Maps to a command-line argument: -quiet (position: 1).

vectora pathlike object or string representing an existing file

The output image of the major eigenvectors of the diffusion tensor image.

Threshold

Link to code

Bases: CommandLine

Wrapped executable: threshold.

Create bitwise image by thresholding image intensity.

By default, the threshold level is determined using a histogram analysis to cut out the background. Otherwise, the threshold intensity can be specified using command line options. Note that only the first study is used for thresholding.

Example

>>> import nipype.interfaces.mrtrix as mrt
>>> thresh = mrt.Threshold()
>>> thresh.inputs.in_file = 'wm_mask.mif'
>>> thresh.run()                                             
in_filea pathlike object or string representing an existing file

The input image to be thresholded. Maps to a command-line argument: %s (position: -2).

absolute_threshold_valuea float

Specify threshold value as absolute intensity. Maps to a command-line argument: -abs %s.

argsa string

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

debuga boolean

Display debugging messages. Maps to a command-line argument: -debug (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: {})

inverta boolean

Invert output binary mask. Maps to a command-line argument: -invert (position: 1).

out_filenamea pathlike object or string representing a file

The output binary image mask. Maps to a command-line argument: %s (position: -1).

percentage_threshold_valuea float

Specify threshold value as a percentage of the peak intensity in the input image. Maps to a command-line argument: -percent %s.

quieta boolean

Do not display information messages or progress status. Maps to a command-line argument: -quiet (position: 1).

replace_zeros_with_NaNa boolean

Replace all zero values with NaN. Maps to a command-line argument: -nan (position: 1).

out_filea pathlike object or string representing an existing file

The output binary image mask.