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.

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 referenceimage 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 mappping. 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.

  • 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’) – Tissue segmentation algorithm. Maps to a command-line argument: %s (position: -3).

  • 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.

  • 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.

Outputs

out_file (a pathlike object or string representing an existing file) – Output 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 a float) – 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.

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

  • 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

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) – Specfied 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.

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_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.

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.

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_adc (a pathlike object or string representing a file) – Output ADC file. Maps to a command-line argument: -adc %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.

Outputs
  • out_adc (a pathlike object or string representing a file) – Output ADC 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.