Skip to contents

Performs local PCA denoising in overlapping 3D spatial patches across a temporal window.

Usage

mp_pca4d(
  vec,
  patch = c(5L, 5L, 5L),
  tw = 32L,
  stride = c(3L, 3L, 3L, 8L),
  sigma_mode = c("patch", "global", "fixed"),
  sigma_value = NULL,
  mask = NULL
)

Arguments

vec

4D fMRI array or `NeuroVec`.

patch

Integer length-3 patch size (voxels).

tw

Temporal window size (frames).

stride

Integer length-4 stride for x,y,z,t.

sigma_mode

Noise mode: 'patch' (estimate per-patch), 'global' (one value), or 'fixed'.

sigma_value

Noise sigma when `sigma_mode='fixed'`.

mask

Optional 3D logical/0-1 mask.

Value

Denoised 4D data, wrapped like `vec` when possible.