pub fn unwrap_slicewise(
phase: &[f64],
mag: &[f64],
mask: &[u8],
method: UnwrapMethod,
params: &SliceWiseParams,
grid: &Grid,
) -> Vec<f64>Expand description
Unwrap each slice independently, in plane.
method selects the unwrapper, which runs unchanged on a (d0, d1, 1) grid per slice so
the slice axis is never differentiated across. Masked-out voxels keep whatever the chosen
unwrapper leaves them: zero for UnwrapMethod::Laplacian, the wrapped input for the
region-growing methods.
The result is self-consistent within each slice and determined only up to a multiple of 2π
between slices. For multi-echo data use unwrap_slicewise_multi_echo, which makes that
multiple echo-independent so a fit across echoes cancels it. See the module docs.
§Arguments
phase- Wrapped phase (nx * ny * nz)mag- Magnitude for the weighting ofUnwrapMethod::Romeo; may be emptymask- Binary mask (nx * ny * nz), 1 = inside ROImethod- Which unwrapper to run on each sliceparams- Slice axis and the per-method parametersgrid- Volume grid
§Panics
If params.slice_axis is not 0, 1 or 2, or if phase/mask do not match grid.