Expand description
Multi-echo phase combination and B0 field mapping.
Building blocks for turning multi-echo wrapped phase into a B0 field map:
phase-offset removal (MCPC-3D-S / ASPIRE), weighted B0 estimation,
linear multi-echo fitting, and MEDI’s complex fit (Fit_ppm_complex).
Structs§
- Coil
Combination Result - Result of MCPC-3D-S multi-coil combination (
mcpc3ds_combine). - Echo
Quality - Per-echo evidence that an echo did not fit the model the others agree on.
- FitPpm
Complex Params - Settings of
fit_ppm_complex, theoptsofFit_ppm_complex.m(defaults as there). - FitPpm
Complex Result - Output of
fit_ppm_complex. Each map has one value per voxel. - Linear
FitParams - Parameters for multi-echo linear fit.
- Linear
FitResult - Result of multi-echo linear fit
- Phase
Offset Params - Parameters for phase offset removal.
- Phase
Offset Removal - Result of
phase_offset_removal(MCPC-3D-S on coil-combined echoes). - Robust
FitParams - Parameters for
multi_echo_robust_fit. - Robust
FitResult - A robust multi-echo fit: the field map, and the evidence about each echo that produced it.
Enums§
- B0Weight
Type - B0 weighting types. All but
B0WeightType::AssumedDecaymatch MriResearchTools.jl. - Robust
Loss - How a standardised residual becomes a weight.
Constants§
- FIT_
PPM_ COMPLEX_ SPACING_ TOLERANCE_ S - How far, in seconds, each echo spacing may be from the first for
fit_ppm_complexand MEDI’s noise map (fit_ppm_complex_noise) to count the echoes as evenly spaced: 0.02 ms.
Functions§
- bipolar_
correction - Bipolar gradient correction for multi-echo phase data.
- calculate_
b0_ weighted - Calculate B0 field from unwrapped phase using weighted averaging
- echo_
spacing_ problem - Why
fit_ppm_complex(and so MEDI’s field map and noise map, which every pipeline entry point that runs them checks with this) cannot use these echo times, orNoneif it can: they must be finite, increasing (a single echo afterTE = 0), and evenly spaced, each spacing withinFIT_PPM_COMPLEX_SPACING_TOLERANCE_Sof the first. A host can call this to reject a run before any work starts, and so applies exactly the rule and tolerance QSM.rs does. - field_
to_ hz - Convert field from rad/s to Hz
- fit_
ppm_ complex - Complex multi-echo field fit, a port of
Fit_ppm_complex.m(MEDI toolbox 2024.11.26; Liu et al., MRM 2013;69:467; Kressler et al., IEEE TMI 2010;29:273; de Rochefort et al., MRM 2008;60:1003). - fit_
ppm_ complex_ noise - Noise standard deviation of the field fit, as
Fit_ppm_complex.min the MEDI toolbox returns it (dp1, MEDI’sN_std): the a priori error of the frequency in a magnitude-weighted linear fit of phase to echo index,sqrt(a11 / (a11·a22 − a12²))witha_jk = Σ_e |S_e|² e^(j+k−2)over echo indicese = 0, 1, …. It depends only on the echo magnitudes, so this isfit_ppm_complex’snoisewithout the phase. A single echo is treated asFit_ppm_complex.mdoes, as two echoes of the same magnitude. Voxels where the fit is undefined get 0, as there (MEDI’s data weight then ignores them). - gaussian_
box_ sizes - Box-filter widths approximating a Gaussian of
sigma(voxels) withnpasses — thegetboxsizesof MriResearchTools.jl (Kovesi’s “fast almost-Gaussian” construction). Returns all-ones (i.e. no smoothing) whensigmais not positive. - mcpc3ds_
combine - MCPC-3D-S multi-coil phase combination (Eckstein et al., MRM 2018), as in
MriResearchTools.jl’smcpc3dsfor 5D (multi-echo, uncombined) input. - multi_
echo_ linear_ fit - Multi-echo linear fit with magnitude weighting
- multi_
echo_ robust_ fit - Multi-echo fit that downweights echoes which disagree with the rest, and reports which.
- nan_
box_ smooth_ 3d - Masked 3D smoothing by repeated NaN-aware box filtering — the
maskbranch ofgaussiansmooth3d!in MriResearchTools.jl (4 passes per axis, alternating direction on even passes, box widths fromgaussian_box_sizes). Voxels outsidemaskbecomeNaNbefore filtering and are only given values where the filter extrapolates across the boundary; the result is written in place. - nan_
box_ smooth_ 3d_ phase - Masked phase smoothing via the complex representation, using
nan_box_smooth_3d—gaussiansmooth3d_phase(phase, sigma; mask)of MriResearchTools.jl. ReturnsNaNwhere the smoothed complex value is undefined (far outside the mask). - phase_
offset_ removal - Remove phase offset from multi-echo phase data using HIP (Hermitian Inner Product):
MCPC-3D-S, as MriResearchTools.jl’s
mcpc3dsdoes it for one channel (src/mcpc3ds.jl:38-57, 771eadf; v3.8.0).