Expand description
HARPERELLA and iHARPERELLA: integrated phase unwrapping and background field removal
Both methods remove the background field through the Laplacian. The background field is harmonic inside the brain, so the Laplacian there holds only tissue sources. They estimate the Laplacian outside the brain, add it to the brain’s, and invert the Laplacian over the whole field of view.
iHARPERELLA is a port of STI Suite 3.0’s iHARPERELLA (its protected P-code was recovered by
black-box probing: logging the calls it makes to its helper functions and to MATLAB’s
lsqr, and probing the lsqr operator it builds). HARPERELLA is not in STI Suite 3.0; it
follows the paper, and uses STI’s building blocks for what the paper leaves open (see
harperella).
§Building blocks (STI Suite)
- Laplacian: spectral,
L(x) = F⁻¹[k² F(x)]withkin cycles/mm (STI’sfftncgrid), which is−∇²x / 4π². Its inverse divides byk²and sets the DC term to zero. The scale cancels between the two, so the result is in the input’s units. - Boundary rim: brain voxels with more than one voxel outside the brain among the 146
neighbours of STI’s
ball3D(3)(the offsets with1 ≤ |d|² ≤ 10voxels²), i.e.SMVFiltering(mask, 3) < 0.99. Within the rim, the 20 % of Laplacian values largest in magnitude are set to zero (the paper’s “large Laplacian values near the boundary of the brain … were considered inaccurate and set to zero”). Outside the brain the Laplacian is zero. - Solver: MATLAB’s
lsqr(no preconditioner, zero initial guess) at tolerancetolfor at mostmax_iteriterations; STI passes 0.001 andniter(default 40). - Padding:
padzero voxels on each side (STI’spadsize, default 0).
Past about ten iterations LSQR on these operators amplifies rounding: two implementations whose residuals agree to 1e-14 for the first ten iterations differ by ~1e-3 by the twelfth. So results agree with STI Suite to rounding for a few iterations and to a few percent at 40.
§Input
HarperellaInput::FieldPpm: an unwrapped total field in ppm, e.g. a multi-echo field map. This is what STI’siHARPERELLAdoes with its input: it takes the spectral Laplacian of it as it is (it does not unwrap).HarperellaInput::WrappedPhase: one wrapped echo in rad, as in the HARPERELLA paper: the Laplacian iscos φ L(sin φ) − sin φ L(cos φ)(the paper’s Eq. 1) with the spectralL, and the result is divided byrad_per_ppm(te_s, b0_t).
Either way the output is the local field in ppm, inside the mask.
§Reference pipeline
- Input: STI’s help text and
STI_Templates.mcall it on the “raw phase”, but probed in MATLAB R2023b, STI 3.0’siHARPERELLAdoes not unwrap: on a synthetic head whose phase wraps in 59 % of the brain, its output from the wrapped phase correlates −0.03 with the true local phase, from the unwrapped phase 0.98. HenceHarperellaInput::FieldPpm. - Defaults:
niter40;padsize0 (probed: bitwise equal to[0 0 0], whileSTI_Templates.mlists[12 12 12]).IharperellaParams::defaultmatches the function. - Chain: STI Suite 2.01’s manual has the GUI combine the Laplacians of all echoes (“Combine Laplacian”) and then run iHARPERELLA, as the alternative to “Unwrapping” + V-SHARP, before iLSQR; the mask is the GUI’s magnitude threshold of the 3rd or 4th echo. STI Suite 3.0’s GUI has no iHARPERELLA button (only the function).
References:
- HARPERELLA: Li, W., Avram, A. V., Wu, B., Xiao, X., Liu, C. (2014). “Integrated Laplacian-based phase unwrapping and background phase removal for quantitative susceptibility mapping.” NMR in Biomedicine, 27(2):219-227. doi:10.1002/nbm.3056
- iHARPERELLA: Li, W., Wu, B., Liu, C. (2015). “iHARPERELLA: an improved method for
integrated 3D phase unwrapping and background phase removal.” Proc. ISMRM 23, p.3313.
Code: STI Suite 3.0,
Core_Functions_P/iHARPERELLA.p.
Structs§
- Harperella
Params - HARPERELLA parameters.
- Iharperella
Params - iHARPERELLA parameters (STI Suite’s
iHARPERELLAoptions). It has no SMV kernel. - Work 🔒
- The padded working volume: data, mask, Laplacian (rim cleaned), and the padded grid.
Enums§
- Harperella
Input - What HARPERELLA / iHARPERELLA start from. See the module docs.
Functions§
- apply_
inv_ 🔒kernel F⁻¹[F(x) / k]with thek = 0term set to zero, real part.- apply_
kernel 🔒 F⁻¹[k F(x)], real part.- apply_
smv 🔒 - Apply SMV filter in k-space: S(x) = ifft(s_fft * fft(x))
- compute_
smv_ 🔒fft - Compute FFT of SMV kernel (returns real part, since kernel is symmetric)
- drop_
large_ 🔒rim_ values - Set the 20 % of rim Laplacian values largest in magnitude to zero: keep
|L| ≤the sorted rim magnitude at 1-based indexround(0.8 N). - erode 🔒
- Erode
maskby a sphere ofradiusmm: keep the voxels whose whole sphere lies in the mask. - harperella
- HARPERELLA: the exterior Laplacian makes the SMV of the total Laplacian uniform.
- iharperella
- iHARPERELLA: the exterior Laplacian minimises the weighted resulting field in the brain.
- k2_
kernel 🔒 - STI’s spectral Laplacian kernel
k² = kx² + ky² + kz²,kin cycles/mm, in FFT order. - pad_
centred 🔒 - Pad with
padzero voxels on each side (STI’spadarray(x, padsize)). - shift 🔒
- Circular shift by
svoxels. - sti_rim 🔒
- STI’s boundary rim: mask voxels where
SMVFiltering(mask, 3), the mean of the mask over the 146 neighbours ofball3D(3)(offsets with1 ≤ |d|² ≤ 10voxels², periodic), is below 0.99, i.e. more than one of those neighbours is outside the mask. - to_
complex 🔒 - unpad_
centred 🔒 - Inverse of
pad_centred.