nipype.interfaces.mrtrix3.utils module

BrainMask

Link to code

Bases: CommandLine

Wrapped executable: dwi2mask.

Convert a mesh surface to a partial volume estimation image

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> bmsk = mrt.BrainMask()
>>> bmsk.inputs.in_file = 'dwi.mif'
>>> bmsk.cmdline                               
'dwi2mask dwi.mif brainmask.mif'
>>> bmsk.run()                                 
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – Input diffusion weighted images. Maps to a command-line argument: %s (position: -2).

  • out_file (a pathlike object or string representing a file) – Output brain mask. Maps to a command-line argument: %s (position: -1). (Nipype default value: brainmask.mif)

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • bval_scale (‘yes’ or ‘no’) – Specifies whether the b - values should be scaled by the square of the corresponding DW gradient norm, as often required for multishell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes / no, true / false, 0 / 1 (default: true). Maps to a command-line argument: -bvalue_scaling %s.

  • environ (a 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: {})

  • grad_file (a pathlike object or string representing an existing file) – Dw gradient scheme (MRTrix format). Maps to a command-line argument: -grad %s. Mutually exclusive with inputs: grad_fsl.

  • grad_fsl (a tuple of the form: (a pathlike object or string representing an existing file, a pathlike object or string representing an existing file)) – (bvecs, bvals) dw gradient scheme (FSL format). Maps to a command-line argument: -fslgrad %s %s. Mutually exclusive with inputs: grad_file.

  • in_bval (a pathlike object or string representing an existing file) – Bvals file in FSL format.

  • in_bvec (a pathlike object or string representing an existing file) – Bvecs file in FSL format. Maps to a command-line argument: -fslgrad %s %s.

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_bval (a pathlike object or string representing a file) – Export bval file in FSL format.

  • out_bvec (a pathlike object or string representing a file) – Export bvec file in FSL format. Maps to a command-line argument: -export_grad_fsl %s %s.

Outputs:

out_file (a pathlike object or string representing an existing file) – The output response file.

ComputeTDI

Link to code

Bases: MRTrix3Base

Wrapped executable: tckmap.

Use track data as a form of contrast for producing a high-resolution image.

References

  • For TDI or DEC TDI: Calamante, F.; Tournier, J.-D.; Jackson, G. D. & Connelly, A. Track-density imaging (TDI): Super-resolution white matter imaging using whole-brain track-density mapping. NeuroImage, 2010, 53, 1233-1243

  • If using -contrast length and -stat_vox mean: Pannek, K.; Mathias, J. L.; Bigler, E. D.; Brown, G.; Taylor, J. D. & Rose, S. E. The average pathlength map: A diffusion MRI tractography-derived index for studying brain pathology. NeuroImage, 2011, 55, 133-141

  • If using -dixel option with TDI contrast only: Smith, R.E., Tournier, J-D., Calamante, F., Connelly, A. A novel paradigm for automated segmentation of very large whole-brain probabilistic tractography data sets. In proc. ISMRM, 2011, 19, 673

  • If using -dixel option with any other contrast: Pannek, K., Raffelt, D., Salvado, O., Rose, S. Incorporating directional information in diffusion tractography derived maps: angular track imaging (ATI). In Proc. ISMRM, 2012, 20, 1912

  • If using -tod option: Dhollander, T., Emsell, L., Van Hecke, W., Maes, F., Sunaert, S., Suetens, P. Track Orientation Density Imaging (TODI) and Track Orientation Distribution (TOD) based tractography. NeuroImage, 2014, 94, 312-336

  • If using other contrasts / statistics: Calamante, F.; Tournier, J.-D.; Smith, R. E. & Connelly, A. A generalised framework for super-resolution track-weighted imaging. NeuroImage, 2012, 59, 2494-2503

  • If using -precise mapping option: Smith, R. E.; Tournier, J.-D.; Calamante, F. & Connelly, A. SIFT: Spherical-deconvolution informed filtering of tractograms. NeuroImage, 2013, 67, 298-312 (Appendix 3)

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> tdi = mrt.ComputeTDI()
>>> tdi.inputs.in_file = 'dti.mif'
>>> tdi.cmdline                               
'tckmap dti.mif tdi.mif'
>>> tdi.run()                                 
Mandatory Inputs:

in_file (a pathlike object or string representing an existing file) – Input tractography. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • contrast (‘tdi’ or ‘length’ or ‘invlength’ or ‘scalar_map’ or ‘scalar_map_conut’ or ‘fod_amp’ or ‘curvature’) – Define the desired form of contrast for the output image. Maps to a command-line argument: -constrast %s.

  • data_type (‘float’ or ‘unsigned int’) – Specify output image data type. Maps to a command-line argument: -datatype %s.

  • dixel (a pathlike object or string representing a file) – Map streamlines todixels within each voxel. Directions are stored asazimuth elevation pairs. Maps to a command-line argument: -dixel %s.

  • ends_only (a boolean) – Only map the streamline endpoints to the image. Maps to a command-line argument: -ends_only.

  • environ (a 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: {})

  • fwhm_tck (a float) – Define the statistic for choosing the contribution to be made by each streamline as a function of the samples taken along their lengths. Maps to a command-line argument: -fwhm_tck %f.

  • in_map (a pathlike object or string representing an existing file) – Provide thescalar image map for generating images with ‘scalar_map’ contrasts, or the SHs image for fod_amp. Maps to a command-line argument: -image %s.

  • map_zero (a boolean) – If a streamline has zero contribution based on the contrast & statistic, typically it is not mapped; use this option to still contribute to the map even if this is the case (these non-contributing voxels can then influence the mean value in each voxel of the map). Maps to a command-line argument: -map_zero.

  • max_tod (an integer) – Generate a Track Orientation Distribution (TOD) in each voxel. Maps to a command-line argument: -tod %d.

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_file (a pathlike object or string representing a file) – Output TDI file. Maps to a command-line argument: %s (position: -1). (Nipype default value: tdi.mif)

  • precise (a boolean) – Use a more precise streamline mapping strategy, that accurately quantifies the length through each voxel (these lengths are then taken into account during TWI calculation). Maps to a command-line argument: -precise.

  • reference (a pathlike object or string representing an existing file) – A reference image to be used as template. Maps to a command-line argument: -template %s.

  • stat_tck (‘mean’ or ‘sum’ or ‘min’ or ‘max’ or ‘median’ or ‘mean_nonzero’ or ‘gaussian’ or ‘ends_min’ or ‘ends_mean’ or ‘ends_max’ or ‘ends_prod’) – Define the statistic for choosing the contribution to be made by each streamline as a function of the samples taken along their lengths. Maps to a command-line argument: -stat_tck %s.

  • stat_vox (‘sum’ or ‘min’ or ‘mean’ or ‘max’) – Define the statistic for choosing the finalvoxel intesities for a given contrast. Maps to a command-line argument: -stat_vox %s.

  • tck_weights (a pathlike object or string representing an existing file) – Specify a text scalar file containing the streamline weights. Maps to a command-line argument: -tck_weights_in %s.

  • upsample (an integer) – Upsample the tracks by some ratio using Hermite interpolation before mapping. Maps to a command-line argument: -upsample %d.

  • use_dec (a boolean) – Perform mapping in DEC space. Maps to a command-line argument: -dec.

  • vox_size (a list of items which are an integer) – Voxel dimensions. Maps to a command-line argument: -vox %s.

Outputs:

out_file (a pathlike object or string representing a file) – Output TDI file.

DWIExtract

Link to code

Bases: MRTrix3Base

Wrapped executable: dwiextract.

Extract diffusion-weighted volumes, b=0 volumes, or certain shells from a DWI dataset

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> dwiextract = mrt.DWIExtract()
>>> dwiextract.inputs.in_file = 'dwi.mif'
>>> dwiextract.inputs.bzero = True
>>> dwiextract.inputs.out_file = 'b0vols.mif'
>>> dwiextract.inputs.grad_fsl = ('bvecs', 'bvals')
>>> dwiextract.cmdline                             
'dwiextract -bzero -fslgrad bvecs bvals dwi.mif b0vols.mif'
>>> dwiextract.run()                               
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – Input image. Maps to a command-line argument: %s (position: -2).

  • out_file (a pathlike object or string representing a file) – Output image. Maps to a command-line argument: %s (position: -1).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • bval_scale (‘yes’ or ‘no’) – Specifies whether the b - values should be scaled by the square of the corresponding DW gradient norm, as often required for multishell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes / no, true / false, 0 / 1 (default: true). Maps to a command-line argument: -bvalue_scaling %s.

  • bzero (a boolean) – Extract b=0 volumes. Maps to a command-line argument: -bzero.

  • environ (a 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: {})

  • grad_file (a pathlike object or string representing an existing file) – Dw gradient scheme (MRTrix format). Maps to a command-line argument: -grad %s. Mutually exclusive with inputs: grad_fsl.

  • grad_fsl (a tuple of the form: (a pathlike object or string representing an existing file, a pathlike object or string representing an existing file)) – (bvecs, bvals) dw gradient scheme (FSL format). Maps to a command-line argument: -fslgrad %s %s. Mutually exclusive with inputs: grad_file.

  • in_bval (a pathlike object or string representing an existing file) – Bvals file in FSL format.

  • in_bvec (a pathlike object or string representing an existing file) – Bvecs file in FSL format. Maps to a command-line argument: -fslgrad %s %s.

  • nobzero (a boolean) – Extract non b=0 volumes. Maps to a command-line argument: -no_bzero.

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_bval (a pathlike object or string representing a file) – Export bval file in FSL format.

  • out_bvec (a pathlike object or string representing a file) – Export bvec file in FSL format. Maps to a command-line argument: -export_grad_fsl %s %s.

  • shell (a list of items which are a float) – Specify one or more gradient shells. Maps to a command-line argument: -shell %s.

  • singleshell (a boolean) – Extract volumes with a specific shell. Maps to a command-line argument: -singleshell.

Outputs:

out_file (a pathlike object or string representing an existing file) – Output image.

Generate5tt

Link to code

Bases: MRTrix3Base

Wrapped executable: 5ttgen.

Generate a 5TT image suitable for ACT using the selected algorithm

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> gen5tt = mrt.Generate5tt()
>>> gen5tt.inputs.in_file = 'T1.nii.gz'
>>> gen5tt.inputs.algorithm = 'fsl'
>>> gen5tt.inputs.out_file = '5tt.mif'
>>> gen5tt.cmdline                             
'5ttgen fsl T1.nii.gz 5tt.mif'
>>> gen5tt.run()                               
Mandatory Inputs:
  • algorithm (‘fsl’ or ‘gif’ or ‘freesurfer’ or ‘hsvs’) – Tissue segmentation algorithm. Maps to a command-line argument: %s (position: -3).

  • in_file (a pathlike object or string representing an existing file or a pathlike object or string representing an existing directory) – Input image / directory. Maps to a command-line argument: %s (position: -2).

  • out_file (a pathlike object or string representing a file) – Output image. Maps to a command-line argument: %s (position: -1).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • bval_scale (‘yes’ or ‘no’) – Specifies whether the b - values should be scaled by the square of the corresponding DW gradient norm, as often required for multishell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes / no, true / false, 0 / 1 (default: true). Maps to a command-line argument: -bvalue_scaling %s.

  • environ (a 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: {})

  • grad_file (a pathlike object or string representing an existing file) – Dw gradient scheme (MRTrix format). Maps to a command-line argument: -grad %s. Mutually exclusive with inputs: grad_fsl.

  • grad_fsl (a tuple of the form: (a pathlike object or string representing an existing file, a pathlike object or string representing an existing file)) – (bvecs, bvals) dw gradient scheme (FSL format). Maps to a command-line argument: -fslgrad %s %s. Mutually exclusive with inputs: grad_file.

  • in_bval (a pathlike object or string representing an existing file) – Bvals file in FSL format.

  • in_bvec (a pathlike object or string representing an existing file) – Bvecs file in FSL format. Maps to a command-line argument: -fslgrad %s %s.

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_bval (a pathlike object or string representing a file) – Export bval file in FSL format.

  • out_bvec (a pathlike object or string representing a file) – Export bvec file in FSL format. Maps to a command-line argument: -export_grad_fsl %s %s.

Outputs:

out_file (a pathlike object or string representing an existing file) – Output image.

Generate5tt2gmwmi

Link to code

Bases: CommandLine

Wrapped executable: 5tt2gmwmi.

Generate a mask image appropriate for seeding streamlines on the grey matter-white matter interface

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> gmwmi = mrt.Generate5tt2gmwmi()
>>> gmwmi.inputs.in_file = '5tt_in.mif'
>>> gmwmi.inputs.mask_out = 'mask_gmwmi.mif'
>>> gmwmi.cmdline
'5tt2gmwmi 5tt_in.mif mask_gmwmi.mif'
>>> gmwmi.run()                                 
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – The input 5TT segmented anatomical image. Maps to a command-line argument: %s (position: -2).

  • mask_out (a pathlike object or string representing a file) – The output mask image. Maps to a command-line argument: %s (position: -1).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • bval_scale (‘yes’ or ‘no’) – Specifies whether the b - values should be scaled by the square of the corresponding DW gradient norm, as often required for multishell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes / no, true / false, 0 / 1 (default: true). Maps to a command-line argument: -bvalue_scaling %s.

  • environ (a 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: {})

  • grad_file (a pathlike object or string representing an existing file) – Dw gradient scheme (MRTrix format). Maps to a command-line argument: -grad %s. Mutually exclusive with inputs: grad_fsl.

  • grad_fsl (a tuple of the form: (a pathlike object or string representing an existing file, a pathlike object or string representing an existing file)) – (bvecs, bvals) dw gradient scheme (FSL format). Maps to a command-line argument: -fslgrad %s %s. Mutually exclusive with inputs: grad_file.

  • in_bval (a pathlike object or string representing an existing file) – Bvals file in FSL format.

  • in_bvec (a pathlike object or string representing an existing file) – Bvecs file in FSL format. Maps to a command-line argument: -fslgrad %s %s.

  • mask_in (a pathlike object or string representing a file) – Filter an input mask image according to those voxels that lie upon the grey matter - white matter boundary. Maps to a command-line argument: -mask_in %s (position: -3).

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_bval (a pathlike object or string representing a file) – Export bval file in FSL format.

  • out_bvec (a pathlike object or string representing a file) – Export bvec file in FSL format. Maps to a command-line argument: -export_grad_fsl %s %s.

Outputs:

mask_out (a pathlike object or string representing an existing file) – The output mask file.

MRCat

Link to code

Bases: CommandLine

Wrapped executable: mrcat.

Concatenate several images into one

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> mrcat = mrt.MRCat()
>>> mrcat.inputs.in_files = ['dwi.mif','mask.mif']
>>> mrcat.cmdline                               
'mrcat dwi.mif mask.mif concatenated.mif'
>>> mrcat.run()                                 
Mandatory Inputs:
  • in_files (a list of items which are a pathlike object or string representing an existing file) – Files to concatenate. Maps to a command-line argument: %s (position: -2).

  • out_file (a pathlike object or string representing a file) – Output concatenated image. Maps to a command-line argument: %s (position: -1). (Nipype default value: concatenated.mif)

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • axis (an integer) –

    Specify axis along which concatenation should be performed. By default,

    the program will use the last non-singleton, non-spatial axis of any of the input images - in other words axis 3 or whichever axis (greater than 3) of the input images has size greater than one.

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

  • bval_scale (‘yes’ or ‘no’) – Specifies whether the b - values should be scaled by the square of the corresponding DW gradient norm, as often required for multishell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes / no, true / false, 0 / 1 (default: true). Maps to a command-line argument: -bvalue_scaling %s.

  • datatype (‘float32’ or ‘float32le’ or ‘float32be’ or ‘float64’ or ‘float64le’ or ‘float64be’ or ‘int64’ or ‘uint64’ or ‘int64le’ or ‘uint64le’ or ‘int64be’ or ‘uint64be’ or ‘int32’ or ‘uint32’ or ‘int32le’ or ‘uint32le’ or ‘int32be’ or ‘uint32be’ or ‘int16’ or ‘uint16’ or ‘int16le’ or ‘uint16le’ or ‘int16be’ or ‘uint16be’ or ‘cfloat32’ or ‘cfloat32le’ or ‘cfloat32be’ or ‘cfloat64’ or ‘cfloat64le’ or ‘cfloat64be’ or ‘int8’ or ‘uint8’ or ‘bit’) – Specify output image data type. Maps to a command-line argument: -datatype %s.

  • environ (a 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: {})

  • grad_file (a pathlike object or string representing an existing file) – Dw gradient scheme (MRTrix format). Maps to a command-line argument: -grad %s. Mutually exclusive with inputs: grad_fsl.

  • grad_fsl (a tuple of the form: (a pathlike object or string representing an existing file, a pathlike object or string representing an existing file)) – (bvecs, bvals) dw gradient scheme (FSL format). Maps to a command-line argument: -fslgrad %s %s. Mutually exclusive with inputs: grad_file.

  • in_bval (a pathlike object or string representing an existing file) – Bvals file in FSL format.

  • in_bvec (a pathlike object or string representing an existing file) – Bvecs file in FSL format. Maps to a command-line argument: -fslgrad %s %s.

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_bval (a pathlike object or string representing a file) – Export bval file in FSL format.

  • out_bvec (a pathlike object or string representing a file) – Export bvec file in FSL format. Maps to a command-line argument: -export_grad_fsl %s %s.

Outputs:

out_file (a pathlike object or string representing an existing file) – The output concatenated image.

MRConvert

Link to code

Bases: MRTrix3Base

Wrapped executable: mrconvert.

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

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> mrconvert = mrt.MRConvert()
>>> mrconvert.inputs.in_file = 'dwi.nii.gz'
>>> mrconvert.inputs.grad_fsl = ('bvecs', 'bvals')
>>> mrconvert.cmdline                             
'mrconvert -fslgrad bvecs bvals dwi.nii.gz dwi.mif'
>>> mrconvert.run()                               
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – Input image. Maps to a command-line argument: %s (position: -2).

  • out_file (a pathlike object or string representing a file) – Output image. Maps to a command-line argument: %s (position: -1). (Nipype default value: dwi.mif)

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • axes (a list of items which are an integer) – Specify the axes that will be used. Maps to a command-line argument: -axes %s.

  • bval_scale (‘yes’ or ‘no’) – Specifies whether the b - values should be scaled by the square of the corresponding DW gradient norm, as often required for multishell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes / no, true / false, 0 / 1 (default: true). Maps to a command-line argument: -bvalue_scaling %s.

  • coord (a list of items which are an integer) – Extract data at the specified coordinates. Maps to a command-line argument: -coord %s.

  • environ (a 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: {})

  • grad_file (a pathlike object or string representing an existing file) – Dw gradient scheme (MRTrix format). Maps to a command-line argument: -grad %s. Mutually exclusive with inputs: grad_fsl.

  • grad_fsl (a tuple of the form: (a pathlike object or string representing an existing file, a pathlike object or string representing an existing file)) – (bvecs, bvals) dw gradient scheme (FSL format). Maps to a command-line argument: -fslgrad %s %s. Mutually exclusive with inputs: grad_file.

  • in_bval (a pathlike object or string representing an existing file) – Bvals file in FSL format.

  • in_bvec (a pathlike object or string representing an existing file) – Bvecs file in FSL format. Maps to a command-line argument: -fslgrad %s %s.

  • json_export (a pathlike object or string representing a file) – Export data from an image header key-value pairs into a JSON file. Maps to a command-line argument: -json_export %s.

  • json_import (a pathlike object or string representing an existing file) – Import data from a JSON file into header key-value pairs. Maps to a command-line argument: -json_import %s.

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_bval (a pathlike object or string representing a file) – Export bval file in FSL format.

  • out_bvec (a pathlike object or string representing a file) – Export bvec file in FSL format. Maps to a command-line argument: -export_grad_fsl %s %s.

  • scaling (a list of items which are a float) – Specify the data scaling parameter. Maps to a command-line argument: -scaling %s.

  • vox (a list of items which are a float) – Change the voxel dimensions. Maps to a command-line argument: -vox %s.

Outputs:
  • json_export (a pathlike object or string representing an existing file) – Exported data from an image header key-value pairs in a JSON file.

  • out_bval (a pathlike object or string representing an existing file) – Export bvec file in FSL format.

  • out_bvec (a pathlike object or string representing an existing file) – Export bvec file in FSL format.

  • out_file (a pathlike object or string representing an existing file) – Output image.

MRMath

Link to code

Bases: MRTrix3Base

Wrapped executable: mrmath.

Compute summary statistic on image intensities along a specified axis of a single image

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> mrmath = mrt.MRMath()
>>> mrmath.inputs.in_file = 'dwi.mif'
>>> mrmath.inputs.operation = 'mean'
>>> mrmath.inputs.axis = 3
>>> mrmath.inputs.out_file = 'dwi_mean.mif'
>>> mrmath.inputs.grad_fsl = ('bvecs', 'bvals')
>>> mrmath.cmdline                             
'mrmath -axis 3 -fslgrad bvecs bvals dwi.mif mean dwi_mean.mif'
>>> mrmath.run()                               
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – Input image. Maps to a command-line argument: %s (position: -3).

  • operation (‘mean’ or ‘median’ or ‘sum’ or ‘product’ or ‘rms’ or ‘norm’ or ‘var’ or ‘std’ or ‘min’ or ‘max’ or ‘absmax’ or ‘magmax’) – Operation to computer along a specified axis. Maps to a command-line argument: %s (position: -2).

  • out_file (a pathlike object or string representing a file) – Output image. Maps to a command-line argument: %s (position: -1).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • axis (an integer) – Specified axis to perform the operation along. Maps to a command-line argument: -axis %d.

  • bval_scale (‘yes’ or ‘no’) – Specifies whether the b - values should be scaled by the square of the corresponding DW gradient norm, as often required for multishell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes / no, true / false, 0 / 1 (default: true). Maps to a command-line argument: -bvalue_scaling %s.

  • environ (a 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: {})

  • grad_file (a pathlike object or string representing an existing file) – Dw gradient scheme (MRTrix format). Maps to a command-line argument: -grad %s. Mutually exclusive with inputs: grad_fsl.

  • grad_fsl (a tuple of the form: (a pathlike object or string representing an existing file, a pathlike object or string representing an existing file)) – (bvecs, bvals) dw gradient scheme (FSL format). Maps to a command-line argument: -fslgrad %s %s. Mutually exclusive with inputs: grad_file.

  • in_bval (a pathlike object or string representing an existing file) – Bvals file in FSL format.

  • in_bvec (a pathlike object or string representing an existing file) – Bvecs file in FSL format. Maps to a command-line argument: -fslgrad %s %s.

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_bval (a pathlike object or string representing a file) – Export bval file in FSL format.

  • out_bvec (a pathlike object or string representing a file) – Export bvec file in FSL format. Maps to a command-line argument: -export_grad_fsl %s %s.

Outputs:

out_file (a pathlike object or string representing an existing file) – Output image.

MRResize

Link to code

Bases: MRTrix3Base

Wrapped executable: mrresize.

Resize an image by defining the new image resolution, voxel size or a scale factor. If the image is 4D, then only the first 3 dimensions can be resized. Also, if the image is down-sampled, the appropriate smoothing is automatically applied using Gaussian smoothing. For more information, see <https://mrtrix.readthedocs.io/en/latest/reference/commands/mrresize.html>

Example

>>> import nipype.interfaces.mrtrix3 as mrt

Defining the new image resolution: >>> image_resize = mrt.MRResize() >>> image_resize.inputs.in_file = ‘dwi.mif’ >>> image_resize.inputs.image_size = (256, 256, 144) >>> image_resize.cmdline # doctest: +ELLIPSIS ‘mrresize -size 256,256,144 -interp cubic dwi.mif dwi_resized.mif’ >>> image_resize.run() # doctest: +SKIP

Defining the new image’s voxel size: >>> voxel_resize = mrt.MRResize() >>> voxel_resize.inputs.in_file = ‘dwi.mif’ >>> voxel_resize.inputs.voxel_size = (1, 1, 1) >>> voxel_resize.cmdline # doctest: +ELLIPSIS ‘mrresize -interp cubic -voxel 1,1,1 dwi.mif dwi_resized.mif’ >>> voxel_resize.run() # doctest: +SKIP

Defining the scale factor of each image dimension: >>> scale_resize = mrt.MRResize() >>> scale_resize.inputs.in_file = ‘dwi.mif’ >>> scale_resize.inputs.scale_factor = (0.5,0.5,0.5) >>> scale_resize.cmdline # doctest: +ELLIPSIS ‘mrresize -interp cubic -scale 0.5,0.5,0.5 dwi.mif dwi_resized.mif’ >>> scale_resize.run() # doctest: +SKIP

Mandatory Inputs:
  • image_size (a tuple of the form: (an integer, an integer, an integer)) – Number of voxels in each dimension of output image. Maps to a command-line argument: -size %d,%d,%d. Mutually exclusive with inputs: voxel_size, scale_factor.

  • in_file (a pathlike object or string representing an existing file) – Input DWI image. Maps to a command-line argument: %s (position: -2).

  • scale_factor (a tuple of the form: (a float, a float, a float)) – Scale factors to rescale the image by in each dimension. Maps to a command-line argument: -scale %g,%g,%g. Mutually exclusive with inputs: image_size, voxel_size.

  • voxel_size (a tuple of the form: (a float, a float, a float)) – Desired voxel size in mm for the output image. Maps to a command-line argument: -voxel %g,%g,%g. Mutually exclusive with inputs: image_size, scale_factor.

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • bval_scale (‘yes’ or ‘no’) – Specifies whether the b - values should be scaled by the square of the corresponding DW gradient norm, as often required for multishell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes / no, true / false, 0 / 1 (default: true). Maps to a command-line argument: -bvalue_scaling %s.

  • environ (a 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: {})

  • grad_file (a pathlike object or string representing an existing file) – Dw gradient scheme (MRTrix format). Maps to a command-line argument: -grad %s. Mutually exclusive with inputs: grad_fsl.

  • grad_fsl (a tuple of the form: (a pathlike object or string representing an existing file, a pathlike object or string representing an existing file)) – (bvecs, bvals) dw gradient scheme (FSL format). Maps to a command-line argument: -fslgrad %s %s. Mutually exclusive with inputs: grad_file.

  • in_bval (a pathlike object or string representing an existing file) – Bvals file in FSL format.

  • in_bvec (a pathlike object or string representing an existing file) – Bvecs file in FSL format. Maps to a command-line argument: -fslgrad %s %s.

  • interpolation (‘cubic’ or ‘nearest’ or ‘linear’ or ‘sinc’) – Set the interpolation method to use when resizing (choices: nearest, linear, cubic, sinc. Default: cubic). Maps to a command-line argument: -interp %s. (Nipype default value: cubic)

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_bval (a pathlike object or string representing a file) – Export bval file in FSL format.

  • out_bvec (a pathlike object or string representing a file) – Export bvec file in FSL format. Maps to a command-line argument: -export_grad_fsl %s %s.

  • out_file (a pathlike object or string representing a file) – The output resized DWI image. Maps to a command-line argument: %s (position: -1).

Outputs:

out_file (a pathlike object or string representing an existing file) – The output resized DWI image.

MRTransform

Link to code

Bases: MRTrix3Base

Wrapped executable: mrtransform.

Apply spatial transformations or reslice images

Example

>>> MRxform = MRTransform()
>>> MRxform.inputs.in_files = 'anat_coreg.mif'
>>> MRxform.run()                                   
Mandatory Inputs:

in_files (a 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).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • bval_scale (‘yes’ or ‘no’) – Specifies whether the b - values should be scaled by the square of the corresponding DW gradient norm, as often required for multishell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes / no, true / false, 0 / 1 (default: true). Maps to a command-line argument: -bvalue_scaling %s.

  • debug (a boolean) – Display debugging messages. Maps to a command-line argument: -debug.

  • environ (a 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_x (a 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.

  • grad_file (a pathlike object or string representing an existing file) – Dw gradient scheme (MRTrix format). Maps to a command-line argument: -grad %s. Mutually exclusive with inputs: grad_fsl.

  • grad_fsl (a tuple of the form: (a pathlike object or string representing an existing file, a pathlike object or string representing an existing file)) – (bvecs, bvals) dw gradient scheme (FSL format). Maps to a command-line argument: -fslgrad %s %s. Mutually exclusive with inputs: grad_file.

  • in_bval (a pathlike object or string representing an existing file) – Bvals file in FSL format.

  • in_bvec (a pathlike object or string representing an existing file) – Bvecs file in FSL format. Maps to a command-line argument: -fslgrad %s %s.

  • invert (a boolean) – Invert the specified transform before using it. Maps to a command-line argument: -inverse.

  • linear_transform (a 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.

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_bval (a pathlike object or string representing a file) – Export bval file in FSL format.

  • out_bvec (a pathlike object or string representing a file) – Export bvec file in FSL format. Maps to a command-line argument: -export_grad_fsl %s %s.

  • out_file (a pathlike object or string representing a file) – Output image. Maps to a command-line argument: %s (position: -1).

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

  • reference_image (a 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.

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

  • template_image (a 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.

  • transformation_file (a 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.

Outputs:

out_file (a pathlike object or string representing an existing file) – The output image of the transformation.

MTNormalise

Link to code

Bases: CommandLine

Wrapped executable: mtnormalise.

Multi-tissue informed log-domain intensity normalisation

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> mtn = mrt.MTNormalise()
>>> mtn.inputs.wm_fod = 'wmfod.mif'
>>> mtn.inputs.gm_fod = 'gmfod.mif'
>>> mtn.inputs.csf_fod = 'csffod.mif'
>>> mtn.inputs.out_file_wm = 'wmfod_norm.mif'
>>> mtn.inputs.out_file_gm = 'gmfod_norm.mif'
>>> mtn.inputs.out_file_csf = 'csffod_norm.mif'
>>> mtn.inputs.mask = 'mask.mif'
>>> mtn.cmdline
'mtnormalise wmfod.mif wmfod_norm.mif gmfod.mif gmfod_norm.mif csffod.mif csffod_norm.mif -mask mask.mif'
>>> mtn.run()                                 
Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • bval_scale (‘yes’ or ‘no’) – Specifies whether the b - values should be scaled by the square of the corresponding DW gradient norm, as often required for multishell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes / no, true / false, 0 / 1 (default: true). Maps to a command-line argument: -bvalue_scaling %s.

  • csf_fod (a pathlike object or string representing an existing file) – Input fod of CSF tissue compartment. Maps to a command-line argument: %s (position: 5).

  • environ (a 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: {})

  • gm_fod (a pathlike object or string representing an existing file) – Input fod of grey matter tissue compartment. Maps to a command-line argument: %s (position: 3).

  • grad_file (a pathlike object or string representing an existing file) – Dw gradient scheme (MRTrix format). Maps to a command-line argument: -grad %s. Mutually exclusive with inputs: grad_fsl.

  • grad_fsl (a tuple of the form: (a pathlike object or string representing an existing file, a pathlike object or string representing an existing file)) – (bvecs, bvals) dw gradient scheme (FSL format). Maps to a command-line argument: -fslgrad %s %s. Mutually exclusive with inputs: grad_file.

  • in_bval (a pathlike object or string representing an existing file) – Bvals file in FSL format.

  • in_bvec (a pathlike object or string representing an existing file) – Bvecs file in FSL format. Maps to a command-line argument: -fslgrad %s %s.

  • mask (a pathlike object or string representing an existing file) – Input brain mask. Maps to a command-line argument: -mask %s (position: -1).

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_bval (a pathlike object or string representing a file) – Export bval file in FSL format.

  • out_bvec (a pathlike object or string representing a file) – Export bvec file in FSL format. Maps to a command-line argument: -export_grad_fsl %s %s.

  • out_file_csf (a pathlike object or string representing a file) – Output file of CSF tissue compartment 3. Maps to a command-line argument: %s (position: 6).

  • out_file_gm (a pathlike object or string representing a file) – Output file of grey matter tissue compartment. Maps to a command-line argument: %s (position: 4).

  • out_file_wm (a pathlike object or string representing a file) – Output file of white matter tissue compartment. Maps to a command-line argument: %s (position: 2).

  • wm_fod (a pathlike object or string representing an existing file) – Input fod of white matter tissue compartment. Maps to a command-line argument: %s (position: 1).

Outputs:
  • out_file_csf (a pathlike object or string representing an existing file) – The normalized csf fod.

  • out_file_gm (a pathlike object or string representing an existing file) – The normalized grey matter fod.

  • out_file_wm (a pathlike object or string representing an existing file) – The normalized white matter fod.

MaskFilter

Link to code

Bases: CommandLine

Wrapped executable: maskfilter.

Perform filtering operations on 3D / 4D mask images. Only supports dilate / erode filters at the moment. For more information see: https://mrtrix.readthedocs.io/en/latest/reference/commands/maskfilter.html

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> mf = mrt.MaskFilter()
>>> mf.inputs.in_file = 'mask.mif'
>>> mf.inputs.filter = 'dilate'
>>> mf.inputs.npass = 2
>>> mf.inputs.out_file = 'mask_filtered.mif'
>>> mf.cmdline
'maskfilter -npass 2 mask.mif dilate mask_filtered.mif'
>>> mf.run()                                 
Mandatory Inputs:
  • filter (a string) – Filter to perform (e.g. dilate, erode). Maps to a command-line argument: %s (position: -2).

  • in_file (a pathlike object or string representing an existing file) – Input mask. Maps to a command-line argument: %s (position: -3).

  • out_file (a pathlike object or string representing a file) – Output mask. Maps to a command-line argument: %s (position: -1).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a 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: {})

  • npass (an integer) – Number of passes. Maps to a command-line argument: -npass %d (position: 1).

Outputs:

out_file (a pathlike object or string representing an existing file) – The filtered output mask.

Mesh2PVE

Link to code

Bases: CommandLine

Wrapped executable: mesh2pve.

Convert a mesh surface to a partial volume estimation image

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> m2p = mrt.Mesh2PVE()
>>> m2p.inputs.in_file = 'surf1.vtk'
>>> m2p.inputs.reference = 'dwi.mif'
>>> m2p.inputs.in_first = 'T1.nii.gz'
>>> m2p.cmdline                               
'mesh2pve -first T1.nii.gz surf1.vtk dwi.mif mesh2volume.nii.gz'
>>> m2p.run()                                 
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – Input mesh. Maps to a command-line argument: %s (position: -3).

  • out_file (a pathlike object or string representing a file) – Output file containing SH coefficients. Maps to a command-line argument: %s (position: -1). (Nipype default value: mesh2volume.nii.gz)

  • reference (a pathlike object or string representing an existing file) – Input reference image. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a 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: {})

  • in_first (a pathlike object or string representing an existing file) – Indicates that the mesh file is provided by FSL FIRST. Maps to a command-line argument: -first %s.

Outputs:

out_file (a pathlike object or string representing an existing file) – The output response file.

SH2Amp

Link to code

Bases: CommandLine

Wrapped executable: sh2amp.

Sample spherical harmonics on a set of gradient orientations. Useful for checking residuals of ODF estimates.

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> sh = mrt.SH2Amp()
>>> sh.inputs.in_file = 'sh.mif'
>>> sh.inputs.directions = 'grads.txt'
>>> sh.cmdline
'sh2amp sh.mif grads.txt sh_amp.mif'
>>> sh.run()                                 
Mandatory Inputs:
  • directions (a pathlike object or string representing an existing file) – The gradient directions along which to sample the spherical harmonics MRtrix format. Maps to a command-line argument: %s (position: -2).

  • in_file (a pathlike object or string representing an existing file) – Input ODF image. Maps to a command-line argument: %s (position: -3).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a 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: {})

  • nonnegative (a boolean) – Cap all negative amplitudes to zero. Maps to a command-line argument: -nonnegative.

  • out_file (a pathlike object or string representing a file) – The output spherical harmonics. Maps to a command-line argument: %s (position: -1). (Nipype default value: <undefined>)

Outputs:

out_file (a pathlike object or string representing an existing file) – The output convoluted spherical harmonics file.

SHConv

Link to code

Bases: CommandLine

Wrapped executable: shconv.

Convolve spherical harmonics with a tissue response function. Useful for checking residuals of ODF estimates.

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> sh = mrt.SHConv()
>>> sh.inputs.in_file = 'csd.mif'
>>> sh.inputs.response = 'response.txt'
>>> sh.cmdline
'shconv csd.mif response.txt csd_shconv.mif'
>>> sh.run()                                 
Mandatory Inputs:
  • in_file (a pathlike object or string representing an existing file) – Input ODF image. Maps to a command-line argument: %s (position: -3).

  • response (a pathlike object or string representing an existing file) – The response function. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a 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_file (a pathlike object or string representing a file) – The output spherical harmonics. Maps to a command-line argument: %s (position: -1). (Nipype default value: <undefined>)

Outputs:

out_file (a pathlike object or string representing an existing file) – The output convoluted spherical harmonics file.

TCK2VTK

Link to code

Bases: MRTrix3Base

Wrapped executable: tck2vtk.

Convert a track file to a vtk format, cave: coordinates are in XYZ coordinates not reference

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> vtk = mrt.TCK2VTK()
>>> vtk.inputs.in_file = 'tracks.tck'
>>> vtk.inputs.reference = 'b0.nii'
>>> vtk.cmdline                               
'tck2vtk -image b0.nii tracks.tck tracks.vtk'
>>> vtk.run()                                 
Mandatory Inputs:

in_file (a pathlike object or string representing an existing file) – Input tractography. Maps to a command-line argument: %s (position: -2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • environ (a 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: {})

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_file (a pathlike object or string representing a file) – Output VTK file. Maps to a command-line argument: %s (position: -1). (Nipype default value: tracks.vtk)

  • reference (a pathlike object or string representing an existing file) – If specified, the properties of this image will be used to convert track point positions from real (scanner) coordinates into image coordinates (in mm). Maps to a command-line argument: -image %s.

  • voxel (a pathlike object or string representing an existing file) – If specified, the properties of this image will be used to convert track point positions from real (scanner) coordinates into image coordinates. Maps to a command-line argument: -image %s.

Outputs:

out_file (a pathlike object or string representing a file) – Output VTK file.

TensorMetrics

Link to code

Bases: CommandLine

Wrapped executable: tensor2metric.

Compute metrics from tensors

Example

>>> import nipype.interfaces.mrtrix3 as mrt
>>> comp = mrt.TensorMetrics()
>>> comp.inputs.in_file = 'dti.mif'
>>> comp.inputs.out_fa = 'fa.mif'
>>> comp.cmdline                               
'tensor2metric -num 1 -fa fa.mif dti.mif'
>>> comp.run()                                 
Mandatory Inputs:

in_file (a pathlike object or string representing an existing file) – Input DTI image. Maps to a command-line argument: %s (position: -1).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • component (a list of items which are any value) – Specify the desired eigenvalue/eigenvector(s). Note that several eigenvalues can be specified as a number sequence. Maps to a command-line argument: -num %s. (Nipype default value: [1])

  • environ (a 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: {})

  • in_mask (a 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.

  • modulate (‘FA’ or ‘none’ or ‘eval’) – How to modulate the magnitude of the eigenvectors. Maps to a command-line argument: -modulate %s.

  • out_ad (a pathlike object or string representing a file) – Output AD file. Maps to a command-line argument: -ad %s.

  • out_adc (a pathlike object or string representing a file) – Output ADC file. Maps to a command-line argument: -adc %s.

  • out_cl (a pathlike object or string representing a file) – Output CL file. Maps to a command-line argument: -cl %s.

  • out_cp (a pathlike object or string representing a file) – Output CP file. Maps to a command-line argument: -cp %s.

  • out_cs (a pathlike object or string representing a file) – Output CS file. Maps to a command-line argument: -cs %s.

  • out_eval (a pathlike object or string representing a file) – Output selected eigenvalue(s) file. Maps to a command-line argument: -value %s.

  • out_evec (a pathlike object or string representing a file) – Output selected eigenvector(s) file. Maps to a command-line argument: -vector %s.

  • out_fa (a pathlike object or string representing a file) – Output FA file. Maps to a command-line argument: -fa %s.

  • out_rd (a pathlike object or string representing a file) – Output RD file. Maps to a command-line argument: -rd %s.

Outputs:
  • out_ad (a pathlike object or string representing a file) – Output AD file.

  • out_adc (a pathlike object or string representing a file) – Output ADC file.

  • out_cl (a pathlike object or string representing a file) – Output CL file.

  • out_cp (a pathlike object or string representing a file) – Output CP file.

  • out_cs (a pathlike object or string representing a file) – Output CS file.

  • out_eval (a pathlike object or string representing a file) – Output selected eigenvalue(s) file.

  • out_evec (a pathlike object or string representing a file) – Output selected eigenvector(s) file.

  • out_fa (a pathlike object or string representing a file) – Output FA file.

  • out_rd (a pathlike object or string representing a file) – Output RD file.

TransformFSLConvert

Link to code

Bases: MRTrix3Base

Wrapped executable: transformconvert.

Perform conversion between FSL’s transformation matrix format to mrtrix3’s.

Mandatory Inputs:
  • flirt_import (a boolean) – Import transform from FSL’s FLIRT. Maps to a command-line argument: flirt_import (position: -2). (Nipype default value: True)

  • in_file (a pathlike object or string representing an existing file) – FLIRT input image. Maps to a command-line argument: %s (position: 1).

  • in_transform (a pathlike object or string representing an existing file) – FLIRT output transformation matrix. Maps to a command-line argument: %s (position: 0).

  • out_transform (a pathlike object or string representing a file) – Output transformed affine in mrtrix3’s format. Maps to a command-line argument: %s (position: -1). (Nipype default value: transform_mrtrix.txt)

  • reference (a pathlike object or string representing an existing file) – FLIRT reference image. Maps to a command-line argument: %s (position: 2).

Optional Inputs:
  • args (a string) – Additional parameters to the command. Maps to a command-line argument: %s.

  • bval_scale (‘yes’ or ‘no’) – Specifies whether the b - values should be scaled by the square of the corresponding DW gradient norm, as often required for multishell or DSI DW acquisition schemes. The default action can also be set in the MRtrix config file, under the BValueScaling entry. Valid choices are yes / no, true / false, 0 / 1 (default: true). Maps to a command-line argument: -bvalue_scaling %s.

  • environ (a 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: {})

  • grad_file (a pathlike object or string representing an existing file) – Dw gradient scheme (MRTrix format). Maps to a command-line argument: -grad %s. Mutually exclusive with inputs: grad_fsl.

  • grad_fsl (a tuple of the form: (a pathlike object or string representing an existing file, a pathlike object or string representing an existing file)) – (bvecs, bvals) dw gradient scheme (FSL format). Maps to a command-line argument: -fslgrad %s %s. Mutually exclusive with inputs: grad_file.

  • in_bval (a pathlike object or string representing an existing file) – Bvals file in FSL format.

  • in_bvec (a pathlike object or string representing an existing file) – Bvecs file in FSL format. Maps to a command-line argument: -fslgrad %s %s.

  • nthreads (an integer) – Number of threads. if zero, the number of available cpus will be used. Maps to a command-line argument: -nthreads %d.

  • out_bval (a pathlike object or string representing a file) – Export bval file in FSL format.

  • out_bvec (a pathlike object or string representing a file) – Export bvec file in FSL format. Maps to a command-line argument: -export_grad_fsl %s %s.

Outputs:

out_transform (a pathlike object or string representing an existing file) – Output transformed affine in mrtrix3’s format.