Skip to content

Voxelwise reducers have no NaN handling: one NaN subject poisons voxels; an all-NaN subject yields an all-NaN group map (silent) #7

Description

@bbuchsbaum

Summary

The voxelwise reducers do no NaN handling across subjects. If any included
subject is NaN at a voxel, the group estimate at that voxel is NaN (no
listwise/pairwise deletion). When a subject's map is entirely NaN, the whole
group map is NaN. This is silent — no warning, no error, just an all-NaN output.

Reproduce

32 subjects, one contrast whose first-level map is all-NaN for 5 subjects
(here: a parametric-modulation coefficient that was unestimable for subjects with
constant ratings):

maps <- data.frame(file = beta_files, subject = subs, contrast = "vividness")
g   <- gds_from_nifti_maps(maps)
fit <- one_sample(g, col_data = data.frame(row.names = subs)) |> compute()
t   <- assays(fit)[["t_coef:(Intercept)"]]
sum(is.finite(t) & t != 0)        # 0  -> entire group t-map is NaN

The same poisoning affects per-voxel NaNs for the OLS reducer and the
reduce(method = "random"/"fixed") meta reducers. Workaround: drop all-NaN
subjects before fitting (only rescues the whole-subject case, not scattered
per-voxel NaNs).

Requests

  1. Per-voxel availability handling: estimate from the finite subjects at each
    voxel (reduced n/df), as standard second-level fMRI tools do.
  2. At minimum, warn when subjects/voxels are dropped (or when a voxel has
    <2 finite observations), instead of silently emitting NaN.
  3. A summary of effective-n per voxel (or per fit) would make this auditable.

Env

fmrigds 0.1.0.9000, R 4.5.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions