Warning: This document is for an old version of dmriprep. The main version is master.

dmriprep.interfaces.vectors module

Handling the gradient table.

class dmriprep.interfaces.vectors.CheckGradientTable(from_file=None, resource_monitor=None, **inputs)

Bases: nipype.interfaces.base.core.SimpleInterface

Ensure the correctness of the gradient table.

Example

>>> os.chdir(tmpdir)
>>> check = CheckGradientTable(
...     dwi_file=str(data_dir / 'dwi.nii.gz'),
...     in_rasb=str(data_dir / 'dwi.tsv')).run()
>>> check.outputs.pole
(0.0, 0.0, 0.0)
>>> check.outputs.full_sphere
True
>>> check = CheckGradientTable(
...     dwi_file=str(data_dir / 'dwi.nii.gz'),
...     in_bvec=str(data_dir / 'bvec'),
...     in_bval=str(data_dir / 'bval')).run()
>>> check.outputs.pole
(0.0, 0.0, 0.0)
>>> check.outputs.full_sphere
True
>>> newrasb = np.loadtxt(check.outputs.out_rasb, skiprows=1)
>>> oldrasb = np.loadtxt(str(data_dir / 'dwi.tsv'), skiprows=1)
>>> np.allclose(newrasb, oldrasb, rtol=1.e-3)
True
input_spec

alias of _CheckGradientTableInputSpec

output_spec

alias of _CheckGradientTableOutputSpec