Skip to main content

mppca_denoise

Function mppca_denoise 

Source
pub fn mppca_denoise(
    data: &[f64],
    dims: (usize, usize, usize),
    n_vols: usize,
    patch_radius: usize,
    mask: Option<&[u8]>,
) -> Vec<f64>
Expand description

Denoise multi-volume data with MP-PCA.

§Arguments

  • data - Interleaved [voxel0_vol0, voxel0_vol1, ..., voxel1_vol0, ...] (row-major (n_voxels, n_vols)), the same layout as [r2star_arlo].
  • dims - Volume dimensions (nx, ny, nz).
  • n_vols - Number of volumes (e.g. echoes).
  • patch_radius - Half-width of the cubic patch (radius 2 → 5×5×5).
  • mask - Optional binary mask; masked-out voxels are copied unchanged.

§Returns

Denoised data in the same layout. Voxels within patch_radius of the volume border, or outside the mask, are returned unchanged.