Per-series preprocessing
qsiprep.workflows.dwi.pre_hmc.init_dwi_pre_hmc_wf()
Each DWI series of an output is processed on its own before the series are
concatenated and handed to the head motion backend. Denoising has
assumptions about its input, so the order of these steps is fixed. A series
that belongs to several outputs (a MultipartID list) is denoised once;
every output that includes it reuses that result.
Denoising on the raw series: MP-PCA with
dwidenoise[1], its successordwidenoise2[2],patch2self[3], orsvht_denoise[4], which shrinks the singular values of local patches [5] (--denoise-method). Withpart-phasedata,dwidenoiseanddwidenoise2denoise the complex signal [6], andsvht_denoisedenoises its rotation onto the real axis [7]; either removes the noise floor.Gibbs unringing, off by default:
mrdegibbs[8] for full Fourier acquisitions, TORTOISE’srpg[9] for partial Fourier, orsvht_denoise, which covers full Fourier and 7/8 or 6/8 partial Fourier alongj. Complex-valuedmrdegibbsneeds--mrtrix-version dev; otherwise the data are reduced to magnitude after denoising.Concatenation of the series, with their gradient tables, into one file. The b=0 intensities of the series are rescaled to a common level (
--no-b0-harmonizationskips this).Quality measures on the raw concatenated data, computed with DSI Studio [10] and written to the
raw_columns of the image QC table.
B1 bias field correction is not part of this stage. It runs after
resampling, with N4 [11] on the b=0 images and the resulting
field applied to the whole series (--dwi-biascorrect).
The residuals of denoising and unringing are shown in the visual report, so you can check that they contain noise and ringing rather than anatomy.
The report’s denoising figure: a low-b volume before and after denoising, and what was removed, alternating while the pointer is over it.
The unringing figure works the same way: the unrung low-b and high-b
volumes flicker against the ringing that mrdegibbs or rpg
estimated and removed, which should look like edges, not anatomy.
(Source code, png, svg, pdf)
Gradient nonlinearity correction
qsiprep.workflows.dwi.gradwarp.init_gradwarp_wf()
With --gradient-file, a displacement field is generated once per DWI
run, directly from the raw DWI grid, with TORTOISE’s
CreateNonlinearityDisplacementMap. It is never applied as a resampling
step of its own. It is folded into the transform that resamples the output
at the end of the pipeline, in the order head motion, gradient
nonlinearity, susceptibility distortion, coregistration.
Head motion estimation never sees the field; motion is estimated on the raw
grid, as TORTOISE does. Susceptibility distortion is estimated on
gradient-corrected b=0 and FA images whenever the estimated warp is applied
after the gradient correction, which is the case for DRBUDDI, T2Wreg and SyN
on every backend. A GRE fieldmap is acquired with the same gradients as the
DWI, so its warp is estimated on the raw b=0 and then composed with the
gradient field and its inverse. The exception is the field eddy applies
itself (from TOPUP or a GRE fieldmap): eddy resamples the raw data and
applies the field internally, so the field is estimated on raw b=0 images and
the gradient correction is applied afterwards, at the final resampling.
The b=0 image that coregistration is estimated from is gradient-corrected on every backend, because the coregistration is applied after the gradient correction.
The voxelwise gradient deviation map (see Outputs) is computed
separately, with CreateGradientNonlinearityBMatrix, and does not depend
on whether spatial correction was applied.
Known limitations:
GE coefficient files are not accepted for spatial correction (see Gradient coefficient files).
No gradient deviation map is written for outputs assembled by
--distortion-group-merge; the spatial correction is still applied.The deviation map is oriented by a rigid registration TORTOISE estimates itself, not by the coregistration QSIPrep applied. The two are close but not identical, and this is recorded in the sidecar.