interfaces.mrtrix3.preprocess¶
DWIDenoise¶
Wraps the executable command dwidenoise
.
Denoise DWI data and estimate the noise level based on the optimal threshold for PCA.
DWI data denoising and noise map estimation by exploiting data redundancy in the PCA domain using the prior knowledge that the eigenspectrum of random covariance matrices is described by the universal Marchenko Pastur distribution.
Important note: image denoising must be performed as the first step of the image processing pipeline. The routine will fail if interpolation or smoothing has been applied to the data prior to denoising.
Note that this function does not correct for non-Gaussian noise biases.
For more information, see <https://mrtrix.readthedocs.io/en/latest/reference/commands/dwidenoise.html>
Example¶
>>> import nipype.interfaces.mrtrix3 as mrt
>>> denoise = mrt.DWIDenoise()
>>> denoise.inputs.in_file = 'dwi.mif'
>>> denoise.inputs.mask = 'mask.mif'
>>> denoise.cmdline # doctest: +ELLIPSIS
'dwidenoise -mask mask.mif dwi.mif dwi_denoised.mif'
>>> denoise.run() # doctest: +SKIP
Inputs:
[Mandatory]
in_file: (an existing file name)
input DWI image
argument: ``%s``, position: -2
[Optional]
mask: (an existing file name)
mask image
argument: ``-mask %s``, position: 1
extent: (a tuple of the form: (an integer (int or long), an integer
(int or long), an integer (int or long)))
set the window size of the denoising filter. (default = 5,5,5)
argument: ``-extent %d,%d,%d``
noise: (a file name)
noise map
argument: ``-noise %s``
out_file: (a file name)
the output denoised 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: (an existing file name)
dw gradient scheme (MRTrix format
argument: ``-grad %s``
grad_fsl: (a tuple of the form: (an existing file name, an existing
file name))
(bvecs, bvals) dw gradient scheme (FSL format
argument: ``-fslgrad %s %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).
argument: ``-bvalue_scaling %s``
in_bvec: (an existing file name)
bvecs file in FSL format
argument: ``-fslgrad %s %s``
in_bval: (an existing file name)
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: (an existing file name)
the output denoised DWI image
ResponseSD¶
Wraps the executable command dwi2response
.
Estimate response function(s) for spherical deconvolution using the specified algorithm.
Example¶
>>> import nipype.interfaces.mrtrix3 as mrt
>>> resp = mrt.ResponseSD()
>>> resp.inputs.in_file = 'dwi.mif'
>>> resp.inputs.algorithm = 'tournier'
>>> resp.inputs.grad_fsl = ('bvecs', 'bvals')
>>> resp.cmdline # doctest: +ELLIPSIS
'dwi2response tournier -fslgrad bvecs bvals -lmax 8 dwi.mif wm.txt'
>>> resp.run() # doctest: +SKIP
# We can also pass in multiple harmonic degrees in the case of multi-shell >>> resp.inputs.max_sh = [6,8,10] >>> resp.cmdline ‘dwi2response tournier -fslgrad bvecs bvals -lmax 6,8,10 dwi.mif wm.txt’
Inputs:
[Mandatory]
algorithm: ('msmt_5tt' or 'dhollander' or 'tournier' or 'tax')
response estimation algorithm (multi-tissue)
argument: ``%s``, position: 1
in_file: (an existing file name)
input DWI image
argument: ``%s``, position: -5
[Optional]
mtt_file: (a file name)
input 5tt image
argument: ``%s``, position: -4
wm_file: (a file name, nipype default value: wm.txt)
output WM response text file
argument: ``%s``, position: -3
gm_file: (a file name)
output GM response text file
argument: ``%s``, position: -2
csf_file: (a file name)
output CSF response text file
argument: ``%s``, position: -1
in_mask: (an existing file name)
provide initial mask image
argument: ``-mask %s``
max_sh: (a list of items which are an integer (int or long), nipype
default value: [8])
maximum harmonic degree of response function - single value for
single-shell response, list for multi-shell response
argument: ``-lmax %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: (an existing file name)
dw gradient scheme (MRTrix format
argument: ``-grad %s``
grad_fsl: (a tuple of the form: (an existing file name, an existing
file name))
(bvecs, bvals) dw gradient scheme (FSL format
argument: ``-fslgrad %s %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).
argument: ``-bvalue_scaling %s``
in_bvec: (an existing file name)
bvecs file in FSL format
argument: ``-fslgrad %s %s``
in_bval: (an existing file name)
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:
wm_file: (a file name)
output WM response text file
argument: ``%s``
gm_file: (a file name)
output GM response text file
argument: ``%s``
csf_file: (a file name)
output CSF response text file
argument: ``%s``