dmriprep.interfaces package

Submodules

dmriprep.interfaces.fmap module

Interfaces to deal with the various types of fieldmap sources

class dmriprep.interfaces.fmap.FieldEnhance(from_file=None, resource_monitor=None, **inputs)[source]

Bases: nipype.interfaces.base.core.SimpleInterface

The FieldEnhance interface wraps a workflow to massage the input fieldmap and return it masked, despiked, etc.

input_spec

alias of FieldEnhanceInputSpec

output_spec

alias of FieldEnhanceOutputSpec

class dmriprep.interfaces.fmap.FieldEnhanceInputSpec(**kwargs)[source]

Bases: nipype.interfaces.base.specs.BaseInterfaceInputSpec

class dmriprep.interfaces.fmap.FieldEnhanceOutputSpec(**kwargs)[source]

Bases: nipype.interfaces.base.specs.TraitedSpec

class dmriprep.interfaces.fmap.FieldToHz(from_file=None, resource_monitor=None, **inputs)[source]

Bases: nipype.interfaces.base.core.SimpleInterface

The FieldToHz converts from arbitrary units to Hz

input_spec

alias of FieldToHzInputSpec

output_spec

alias of FieldToHzOutputSpec

class dmriprep.interfaces.fmap.FieldToHzInputSpec(**kwargs)[source]

Bases: nipype.interfaces.base.specs.BaseInterfaceInputSpec

class dmriprep.interfaces.fmap.FieldToHzOutputSpec(**kwargs)[source]

Bases: nipype.interfaces.base.specs.TraitedSpec

class dmriprep.interfaces.fmap.FieldToRadS(from_file=None, resource_monitor=None, **inputs)[source]

Bases: nipype.interfaces.base.core.SimpleInterface

The FieldToRadS converts from arbitrary units to rad/s

input_spec

alias of FieldToRadSInputSpec

output_spec

alias of FieldToRadSOutputSpec

class dmriprep.interfaces.fmap.FieldToRadSInputSpec(**kwargs)[source]

Bases: nipype.interfaces.base.specs.BaseInterfaceInputSpec

class dmriprep.interfaces.fmap.FieldToRadSOutputSpec(**kwargs)[source]

Bases: nipype.interfaces.base.specs.TraitedSpec

class dmriprep.interfaces.fmap.Phasediff2Fieldmap(from_file=None, resource_monitor=None, **inputs)[source]

Bases: nipype.interfaces.base.core.SimpleInterface

Convert a phase difference map into a fieldmap in Hz

input_spec

alias of Phasediff2FieldmapInputSpec

output_spec

alias of Phasediff2FieldmapOutputSpec

class dmriprep.interfaces.fmap.Phasediff2FieldmapInputSpec(**kwargs)[source]

Bases: nipype.interfaces.base.specs.BaseInterfaceInputSpec

class dmriprep.interfaces.fmap.Phasediff2FieldmapOutputSpec(**kwargs)[source]

Bases: nipype.interfaces.base.specs.TraitedSpec

class dmriprep.interfaces.fmap.Phases2Fieldmap(from_file=None, resource_monitor=None, **inputs)[source]

Bases: nipype.interfaces.base.core.SimpleInterface

Convert a phase1, phase2 into a difference map

input_spec

alias of Phases2FieldmapInputSpec

output_spec

alias of Phases2FieldmapOutputSpec

class dmriprep.interfaces.fmap.Phases2FieldmapInputSpec(**kwargs)[source]

Bases: nipype.interfaces.base.specs.BaseInterfaceInputSpec

class dmriprep.interfaces.fmap.Phases2FieldmapOutputSpec(**kwargs)[source]

Bases: nipype.interfaces.base.specs.TraitedSpec

dmriprep.interfaces.fmap.get_ees(in_meta, in_file=None)[source]

Calculate the effective echo spacing \(t_\text{ees}\) for an input EPI scan.

There are several procedures to calculate the effective echo spacing. The basic one is that an EffectiveEchoSpacing field is set in the JSON sidecar. The following examples use an 'epi.nii.gz' file-stub which has 90 pixels in the j-axis encoding direction.

>>> meta = {'EffectiveEchoSpacing': 0.00059,
...         'PhaseEncodingDirection': 'j-'}
>>> get_ees(meta)
0.00059

If the total readout time \(T_\text{ro}\) (TotalReadoutTime BIDS field) is provided, then the effective echo spacing can be calculated reading the number of voxels \(N_\text{PE}\) along the readout direction and the parallel acceleration factor of the EPI

\[= T_\text{ro} \, (N_\text{PE} / f_\text{acc} - 1)^{-1}\]

where \(N_y\) is the number of pixels along the phase-encoding direction \(y\), and \(f_\text{acc}\) is the parallel imaging acceleration factor (GRAPPA, ARC, etc.).

>>> meta = {'TotalReadoutTime': 0.02596,
...         'PhaseEncodingDirection': 'j-',
...         'ParallelReductionFactorInPlane': 2}
>>> get_ees(meta, in_file='epi.nii.gz')
0.00059

Some vendors, like Philips, store different parameter names (see http://dbic.dartmouth.edu/pipermail/mrusers/attachments/20141112/eb1d20e6/attachment.pdf):

>>> meta = {'WaterFatShift': 8.129,
...         'MagneticFieldStrength': 3,
...         'PhaseEncodingDirection': 'j-',
...         'ParallelReductionFactorInPlane': 2}
>>> get_ees(meta, in_file='epi.nii.gz')
0.00041602630141921826
dmriprep.interfaces.fmap.get_trt(in_meta, in_file=None)[source]

Calculate the total readout time for an input EPI scan.

There are several procedures to calculate the total readout time. The basic one is that a TotalReadoutTime field is set in the JSON sidecar. The following examples use an 'epi.nii.gz' file-stub which has 90 pixels in the j-axis encoding direction.

>>> meta = {'TotalReadoutTime': 0.02596}
>>> get_trt(meta)
0.02596

If the effective echo spacing \(t_\text{ees}\) (EffectiveEchoSpacing BIDS field) is provided, then the total readout time can be calculated reading the number of voxels along the readout direction \(T_\text{ro}\) and the parallel acceleration factor of the EPI \(f_\text{acc}\).

\[T_\text{ro} = t_\text{ees} \, (N_\text{PE} / f_\text{acc} - 1)\]
>>> meta = {'EffectiveEchoSpacing': 0.00059,
...         'PhaseEncodingDirection': 'j-',
...         'ParallelReductionFactorInPlane': 2}
>>> get_trt(meta, in_file='epi.nii.gz')
0.02596

Some vendors, like Philips, store different parameter names:

>>> meta = {'WaterFatShift': 8.129,
...         'MagneticFieldStrength': 3,
...         'PhaseEncodingDirection': 'j-',
...         'ParallelReductionFactorInPlane': 2}
>>> get_trt(meta, in_file='epi.nii.gz')
0.018721183563864822
dmriprep.interfaces.fmap.phases2fmap(phase_files, metadatas, newpath=None)[source]

Calculates a phasediff from two phase images. Assumes monopolar readout.

dmriprep.interfaces.fmap.phdiff2fmap(in_file, delta_te, newpath=None)[source]

Converts the input phase-difference map into a fieldmap in Hz, using the eq. (1) of [Hutton2002]:

\[\Delta B_0 (\text{T}^{-1}) = \frac{\Delta \Theta}{2\pi\gamma \Delta\text{TE}}\]

In this case, we do not take into account the gyromagnetic ratio of the proton (\(\gamma\)), since it will be applied inside TOPUP:

\[\Delta B_0 (\text{Hz}) = \frac{\Delta \Theta}{2\pi \Delta\text{TE}}\]

dmriprep.interfaces.reportlets module

Interfaces to generate speciality reportlets.

class dmriprep.interfaces.reportlets.FieldmapReportlet(**kwargs)[source]

Bases: nipype.interfaces.mixins.reporting.ReportCapableInterface

An abstract mixin to registration nipype interfaces.

input_spec

alias of FieldmapReportletInputSpec

output_spec

alias of nipype.interfaces.mixins.reporting.ReportCapableOutputSpec

class dmriprep.interfaces.reportlets.FieldmapReportletInputSpec(**kwargs)[source]

Bases: nipype.interfaces.mixins.reporting.ReportCapableInputSpec

Module contents