pub fn calculate_swi<P: AsRef<[f64]> + Sync, M: AsRef<[f64]> + Sync>(
phases: &[P],
mags: &[M],
tes: &[f64],
mask: Option<&[u8]>,
grid: &Grid,
params: &SwiParams,
) -> Result<SwiResult, InputError>Expand description
CLEAR-SWI from multi-echo (or single-echo) phase and magnitude.
As CLEARSWI.jl’s calculateSWI(Data(mag, phase, header, TEs), options). See the
module docs for the steps.
§Arguments
phases- Wrapped phase, one volume per echo, in radiansmags- Magnitude, one volume per echotes- Echo times, one per echo (seconds; only their ratios and the weighting use them)mask- Mask the phase is filtered and scaled within.Noneuses CLEAR-SWI’s own: [robust_mask] of the first echo’s magnitude, which covers the headgrid- Volume grid (dimensions and voxel sizes)params- CLEAR-SWI parameters
§Errors
If there are no echoes, the phase, magnitude and echo-time counts differ, an echo time is
not positive and finite (several echoes only), or a volume does not match grid.