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
Mandatory Inputs

dwi_file (a pathlike object or string representing an existing file)

Optional Inputs
  • b0_threshold (a float) – (Nipype default value: 50)

  • b_scale (a boolean) – (Nipype default value: True)

  • bvec_norm_epsilon (a float) – (Nipype default value: 0.1)

  • in_bval (a pathlike object or string representing an existing file) – Mutually exclusive with inputs: in_rasb.

  • in_bvec (a pathlike object or string representing an existing file) – Mutually exclusive with inputs: in_rasb.

  • in_rasb (a pathlike object or string representing an existing file) – Mutually exclusive with inputs: in_bval, in_bvec.

Outputs
  • b0_ixs (a list of items which are an integer)

  • b0_mask (a list of items which are a boolean)

  • full_sphere (a boolean)

  • out_bval (a pathlike object or string representing an existing file)

  • out_bvec (a pathlike object or string representing an existing file)

  • out_rasb (a pathlike object or string representing an existing file)

  • pole (a tuple of the form: (a float, a float, a float))