dmriprep.workflows.dwi.base module

Orchestrating the dMRI-preprocessing workflow.

dmriprep.workflows.dwi.base.init_dwi_wf(*, dwi_series, precomputed=None, fieldmap_id=None, jacobian=False, min_dwi_vols=7)View on GitHub

Build a preprocessing workflow for one DWI run.

This workflow follows the fit/transform architecture, where:

  • Fit stage (--level minimal): Estimates all transforms without applying them, including head motion correction, eddy current correction, susceptibility distortion correction, and coregistration to anatomical space.

  • Transform stage (--level resampling or --level full): Composes all estimated transforms and applies them in a single interpolation step to minimize blurring.

Parameters:
  • dwi_series – List of paths to NIfTI files.

  • precomputed – Dictionary containing precomputed derivatives to reuse, if possible.

  • fieldmap_id – ID of the fieldmap to use to correct this DWI series. If None, no correction will be applied.

  • jacobian – Whether to apply Jacobian modulation during SDC.

  • min_dwi_vols – Minimum number of volumes required to process.

Inputs:
  • t1w_preproc – Preprocessed T1w image.

  • t1w_mask – Brain mask in T1w space.

  • t1w_dseg – Tissue segmentation in T1w space.

  • t1w_tpms – Tissue probability maps.

  • subjects_dir – FreeSurfer subjects directory.

  • subject_id – FreeSurfer subject ID.

  • fsnative2t1w_xfm – Transform from FreeSurfer native to T1w space.

  • fmap, fmap_ref, fmap_coeff, fmap_mask – Fieldmap-related inputs.

  • fmap_id – Fieldmap estimator ID.

  • sdc_method – SDC method identifier.

  • anat2std_xfm – Anatomical to standard space transform(s).

  • std_t1w, std_mask – Standard space reference and mask.

Outputs:
  • hmc_dwiref – 3D b=0 reference for motion correction.

  • coreg_dwiref – SDC-corrected reference for coregistration.

  • dwi_mask – Brain mask in DWI space.

  • motion_xfm – Per-volume motion transforms.

  • dwiref2anat_xfm – DWI-to-anatomical coregistration.

  • dwi_preproc – Preprocessed DWI (if level > minimal).