pub fn run_motion_correction(
phases: &[&[f64]],
magnitudes: &[&[f64]],
mask: &[u8],
metadata: &ScanMetadata,
config: &MotionCorrectionConfig,
progress: &mut dyn FnMut(usize, usize),
) -> Result<MotionCorrectionResult, PipelineError>Expand description
Co-register a multi-echo series onto one of its echoes.
phases and magnitudes are per-echo and must be the same length; magnitude is required
here rather than optional, because registration is estimated on magnitude and there is
nothing to estimate it from without it. mask is the brain mask on the series’ grid.
§Errors
PipelineError::InvalidInput for an empty series, a phase/magnitude count mismatch, or a
reference index that does not name an echo; PipelineError::DimensionMismatch if any volume
disagrees with metadata.dims; PipelineError::AlgorithmError if a registration could not
be evaluated at all (an empty mask, or volumes with no overlap).