interfaces.mrtrix3.utils

BrainMask

Link to code

Wraps the executable command 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                               # doctest: +ELLIPSIS
'dwi2mask dwi.mif brainmask.mif'
>>> bmsk.run()                                 # doctest: +SKIP

Inputs:

[Mandatory]
in_file: (a pathlike object or string representing an existing file)
        input diffusion weighted images
        argument: ``%s``, position: -2
out_file: (a pathlike object or string representing a file, nipype
          default value: brainmask.mif)
        output brain mask
        argument: ``%s``, position: -1

[Optional]
nthreads: (an integer (int or long))
        number of threads. if zero, the number of available cpus will be
        used
        argument: ``-nthreads %d``
grad_file: (a pathlike object or string representing an existing
          file)
        dw gradient scheme (MRTrix format)
        argument: ``-grad %s``
        mutually_exclusive: 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)
        argument: ``-fslgrad %s %s``
        mutually_exclusive: grad_file
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).
        argument: ``-bvalue_scaling %s``
in_bvec: (a pathlike object or string representing an existing file)
        bvecs file in FSL format
        argument: ``-fslgrad %s %s``
in_bval: (a pathlike object or string representing an existing file)
        bvals file in FSL format
args: (a unicode string)
        Additional parameters to the command
        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', nipype default value: {})
        Environment variables

Outputs:

out_file: (a pathlike object or string representing an existing file)
        the output response file

ComputeTDI

Link to code

Wraps the executable command 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                               # doctest: +ELLIPSIS
'tckmap dti.mif tdi.mif'
>>> tdi.run()                                 # doctest: +SKIP

Inputs:

[Mandatory]
in_file: (a pathlike object or string representing an existing file)
        input tractography
        argument: ``%s``, position: -2

[Optional]
out_file: (a pathlike object or string representing a file, nipype
          default value: tdi.mif)
        output TDI file
        argument: ``%s``, position: -1
reference: (a pathlike object or string representing an existing
          file)
        a referenceimage to be used as template
        argument: ``-template %s``
vox_size: (a list of items which are an integer (int or long))
        voxel dimensions
        argument: ``-vox %s``
data_type: ('float' or 'unsigned int')
        specify output image data type
        argument: ``-datatype %s``
use_dec: (a boolean)
        perform mapping in DEC space
        argument: ``-dec``
dixel: (a pathlike object or string representing a file)
        map streamlines todixels within each voxel. Directions are stored
        asazimuth elevation pairs.
        argument: ``-dixel %s``
max_tod: (an integer (int or long))
        generate a Track Orientation Distribution (TOD) in each voxel.
        argument: ``-tod %d``
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
        argument: ``-constrast %s``
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
        argument: ``-image %s``
stat_vox: ('sum' or 'min' or 'mean' or 'max')
        define the statistic for choosing the finalvoxel intesities for a
        given contrast
        argument: ``-stat_vox %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.
        argument: ``-stat_tck %s``
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
        argument: ``-fwhm_tck %f``
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)
        argument: ``-map_zero``
upsample: (an integer (int or long))
        upsample the tracks by some ratio using Hermite interpolation before
        mappping
        argument: ``-upsample %d``
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)
        argument: ``-precise``
ends_only: (a boolean)
        only map the streamline endpoints to the image
        argument: ``-ends_only``
tck_weights: (a pathlike object or string representing an existing
          file)
        specify a text scalar file containing the streamline weights
        argument: ``-tck_weights_in %s``
nthreads: (an integer (int or long))
        number of threads. if zero, the number of available cpus will be
        used
        argument: ``-nthreads %d``
args: (a unicode string)
        Additional parameters to the command
        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', nipype default value: {})
        Environment variables

Outputs:

out_file: (a pathlike object or string representing a file)
        output TDI file

DWIExtract

Link to code

Wraps the executable command 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                             # doctest: +ELLIPSIS
'dwiextract -bzero -fslgrad bvecs bvals dwi.mif b0vols.mif'
>>> dwiextract.run()                               # doctest: +SKIP

Inputs:

[Mandatory]
in_file: (a pathlike object or string representing an existing file)
        input image
        argument: ``%s``, position: -2
out_file: (a pathlike object or string representing a file)
        output image
        argument: ``%s``, position: -1

[Optional]
bzero: (a boolean)
        extract b=0 volumes
        argument: ``-bzero``
nobzero: (a boolean)
        extract non b=0 volumes
        argument: ``-no_bzero``
singleshell: (a boolean)
        extract volumes with a specific shell
        argument: ``-singleshell``
shell: (a list of items which are a float)
        specify one or more gradient shells
        argument: ``-shell %s``
nthreads: (an integer (int or long))
        number of threads. if zero, the number of available cpus will be
        used
        argument: ``-nthreads %d``
grad_file: (a pathlike object or string representing an existing
          file)
        dw gradient scheme (MRTrix format)
        argument: ``-grad %s``
        mutually_exclusive: 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)
        argument: ``-fslgrad %s %s``
        mutually_exclusive: grad_file
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).
        argument: ``-bvalue_scaling %s``
in_bvec: (a pathlike object or string representing an existing file)
        bvecs file in FSL format
        argument: ``-fslgrad %s %s``
in_bval: (a pathlike object or string representing an existing file)
        bvals file in FSL format
args: (a unicode string)
        Additional parameters to the command
        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', nipype default value: {})
        Environment variables

Outputs:

out_file: (a pathlike object or string representing an existing file)
        output image

Generate5tt

Link to code

Wraps the executable command 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                             # doctest: +ELLIPSIS
'5ttgen fsl T1.nii.gz 5tt.mif'
>>> gen5tt.run()                               # doctest: +SKIP

Inputs:

[Mandatory]
algorithm: ('fsl' or 'gif' or 'freesurfer')
        tissue segmentation algorithm
        argument: ``%s``, position: -3
in_file: (a pathlike object or string representing an existing file)
        input image
        argument: ``%s``, position: -2
out_file: (a pathlike object or string representing a file)
        output image
        argument: ``%s``, position: -1

[Optional]
nthreads: (an integer (int or long))
        number of threads. if zero, the number of available cpus will be
        used
        argument: ``-nthreads %d``
grad_file: (a pathlike object or string representing an existing
          file)
        dw gradient scheme (MRTrix format)
        argument: ``-grad %s``
        mutually_exclusive: 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)
        argument: ``-fslgrad %s %s``
        mutually_exclusive: grad_file
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).
        argument: ``-bvalue_scaling %s``
in_bvec: (a pathlike object or string representing an existing file)
        bvecs file in FSL format
        argument: ``-fslgrad %s %s``
in_bval: (a pathlike object or string representing an existing file)
        bvals file in FSL format
args: (a unicode string)
        Additional parameters to the command
        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', nipype default value: {})
        Environment variables

Outputs:

out_file: (a pathlike object or string representing an existing file)
        output image

MRConvert

Link to code

Wraps the executable command 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                             # doctest: +ELLIPSIS
'mrconvert -fslgrad bvecs bvals dwi.nii.gz dwi.mif'
>>> mrconvert.run()                               # doctest: +SKIP

Inputs:

[Mandatory]
in_file: (a pathlike object or string representing an existing file)
        input image
        argument: ``%s``, position: -2
out_file: (a pathlike object or string representing a file, nipype
          default value: dwi.mif)
        output image
        argument: ``%s``, position: -1

[Optional]
coord: (a list of items which are a float)
        extract data at the specified coordinates
        argument: ``-coord %s``
vox: (a list of items which are a float)
        change the voxel dimensions
        argument: ``-vox %s``
axes: (a list of items which are an integer (int or long))
        specify the axes that will be used
        argument: ``-axes %s``
scaling: (a list of items which are a float)
        specify the data scaling parameter
        argument: ``-scaling %s``
nthreads: (an integer (int or long))
        number of threads. if zero, the number of available cpus will be
        used
        argument: ``-nthreads %d``
grad_file: (a pathlike object or string representing an existing
          file)
        dw gradient scheme (MRTrix format)
        argument: ``-grad %s``
        mutually_exclusive: 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)
        argument: ``-fslgrad %s %s``
        mutually_exclusive: grad_file
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).
        argument: ``-bvalue_scaling %s``
in_bvec: (a pathlike object or string representing an existing file)
        bvecs file in FSL format
        argument: ``-fslgrad %s %s``
in_bval: (a pathlike object or string representing an existing file)
        bvals file in FSL format
args: (a unicode string)
        Additional parameters to the command
        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', nipype default value: {})
        Environment variables

Outputs:

out_file: (a pathlike object or string representing an existing file)
        output image

MRMath

Link to code

Wraps the executable command 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                             # doctest: +ELLIPSIS
'mrmath -axis 3 -fslgrad bvecs bvals dwi.mif mean dwi_mean.mif'
>>> mrmath.run()                               # doctest: +SKIP

Inputs:

[Mandatory]
in_file: (a pathlike object or string representing an existing file)
        input image
        argument: ``%s``, position: -3
out_file: (a pathlike object or string representing a file)
        output image
        argument: ``%s``, position: -1
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
        argument: ``%s``, position: -2

[Optional]
axis: (an integer (int or long))
        specfied axis to perform the operation along
        argument: ``-axis %d``
nthreads: (an integer (int or long))
        number of threads. if zero, the number of available cpus will be
        used
        argument: ``-nthreads %d``
grad_file: (a pathlike object or string representing an existing
          file)
        dw gradient scheme (MRTrix format)
        argument: ``-grad %s``
        mutually_exclusive: 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)
        argument: ``-fslgrad %s %s``
        mutually_exclusive: grad_file
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).
        argument: ``-bvalue_scaling %s``
in_bvec: (a pathlike object or string representing an existing file)
        bvecs file in FSL format
        argument: ``-fslgrad %s %s``
in_bval: (a pathlike object or string representing an existing file)
        bvals file in FSL format
args: (a unicode string)
        Additional parameters to the command
        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', nipype default value: {})
        Environment variables

Outputs:

out_file: (a pathlike object or string representing an existing file)
        output image

MRResize

Link to code

Wraps the executable command 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

Inputs:

[Mandatory]
in_file: (a pathlike object or string representing an existing file)
        input DWI image
        argument: ``%s``, position: -2
image_size: (a tuple of the form: (an integer (int or long), an
          integer (int or long), an integer (int or long)))
        Number of voxels in each dimension of output image
        argument: ``-size %d,%d,%d``
        mutually_exclusive: voxel_size, scale_factor
voxel_size: (a tuple of the form: (a float, a float, a float))
        Desired voxel size in mm for the output image
        argument: ``-voxel %g,%g,%g``
        mutually_exclusive: image_size, scale_factor
scale_factor: (a tuple of the form: (a float, a float, a float))
        Scale factors to rescale the image by in each dimension
        argument: ``-scale %g,%g,%g``
        mutually_exclusive: image_size, voxel_size

[Optional]
interpolation: ('cubic' or 'nearest' or 'linear' or 'sinc', nipype
          default value: cubic)
        set the interpolation method to use when resizing (choices: nearest,
        linear, cubic, sinc. Default: cubic).
        argument: ``-interp %s``
out_file: (a pathlike object or string representing a file)
        the output resized DWI image
        argument: ``%s``, position: -1
nthreads: (an integer (int or long))
        number of threads. if zero, the number of available cpus will be
        used
        argument: ``-nthreads %d``
grad_file: (a pathlike object or string representing an existing
          file)
        dw gradient scheme (MRTrix format)
        argument: ``-grad %s``
        mutually_exclusive: 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)
        argument: ``-fslgrad %s %s``
        mutually_exclusive: grad_file
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).
        argument: ``-bvalue_scaling %s``
in_bvec: (a pathlike object or string representing an existing file)
        bvecs file in FSL format
        argument: ``-fslgrad %s %s``
in_bval: (a pathlike object or string representing an existing file)
        bvals file in FSL format
args: (a unicode string)
        Additional parameters to the command
        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', nipype default value: {})
        Environment variables

Outputs:

out_file: (a pathlike object or string representing an existing file)
        the output resized DWI image

Mesh2PVE

Link to code

Wraps the executable command 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                               # doctest: +ELLIPSIS
'mesh2pve -first T1.nii.gz surf1.vtk dwi.mif mesh2volume.nii.gz'
>>> m2p.run()                                 # doctest: +SKIP

Inputs:

[Mandatory]
in_file: (a pathlike object or string representing an existing file)
        input mesh
        argument: ``%s``, position: -3
reference: (a pathlike object or string representing an existing
          file)
        input reference image
        argument: ``%s``, position: -2
out_file: (a pathlike object or string representing a file, nipype
          default value: mesh2volume.nii.gz)
        output file containing SH coefficients
        argument: ``%s``, position: -1

[Optional]
in_first: (a pathlike object or string representing an existing file)
        indicates that the mesh file is provided by FSL FIRST
        argument: ``-first %s``
args: (a unicode string)
        Additional parameters to the command
        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', nipype default value: {})
        Environment variables

Outputs:

out_file: (a pathlike object or string representing an existing file)
        the output response file

TCK2VTK

Link to code

Wraps the executable command 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                               # doctest: +ELLIPSIS
'tck2vtk -image b0.nii tracks.tck tracks.vtk'
>>> vtk.run()                                 # doctest: +SKIP

Inputs:

[Mandatory]
in_file: (a pathlike object or string representing an existing file)
        input tractography
        argument: ``%s``, position: -2

[Optional]
out_file: (a pathlike object or string representing a file, nipype
          default value: tracks.vtk)
        output VTK file
        argument: ``%s``, position: -1
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).
        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.
        argument: ``-image %s``
nthreads: (an integer (int or long))
        number of threads. if zero, the number of available cpus will be
        used
        argument: ``-nthreads %d``
args: (a unicode string)
        Additional parameters to the command
        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', nipype default value: {})
        Environment variables

Outputs:

out_file: (a pathlike object or string representing a file)
        output VTK file

TensorMetrics

Link to code

Wraps the executable command 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                               # doctest: +ELLIPSIS
'tensor2metric -num 1 -fa fa.mif dti.mif'
>>> comp.run()                                 # doctest: +SKIP

Inputs:

[Mandatory]
in_file: (a pathlike object or string representing an existing file)
        input DTI image
        argument: ``%s``, position: -1

[Optional]
out_fa: (a pathlike object or string representing a file)
        output FA file
        argument: ``-fa %s``
out_adc: (a pathlike object or string representing a file)
        output ADC file
        argument: ``-adc %s``
out_evec: (a pathlike object or string representing a file)
        output selected eigenvector(s) file
        argument: ``-vector %s``
out_eval: (a pathlike object or string representing a file)
        output selected eigenvalue(s) file
        argument: ``-value %s``
component: (a list of items which are any value, nipype default
          value: [1])
        specify the desired eigenvalue/eigenvector(s). Note that several
        eigenvalues can be specified as a number sequence
        argument: ``-num %s``
in_mask: (a pathlike object or string representing an existing file)
        only perform computation within the specified binary brain mask
        image
        argument: ``-mask %s``
modulate: ('FA' or 'none' or 'eval')
        how to modulate the magnitude of the eigenvectors
        argument: ``-modulate %s``
args: (a unicode string)
        Additional parameters to the command
        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', nipype default value: {})
        Environment variables

Outputs:

out_fa: (a pathlike object or string representing a file)
        output FA file
out_adc: (a pathlike object or string representing a file)
        output ADC file
out_evec: (a pathlike object or string representing a file)
        output selected eigenvector(s) file
out_eval: (a pathlike object or string representing a file)
        output selected eigenvalue(s) file