con / con/mechababs

ds004884: MRIQC QI2 gets NaN on a defaced T1w with zeroed air (nipreps/mriqc#1402)

Open
#153 2 comments 0 reactions 0 assignees View on GitHub
dataset pipeline:mriqc upstream
Dominant language
Python
Stars
1
Forks
4
Avg merge
15h 39m
Merged PRs (30d)
24

Description

tldr:
- ds004884's T1w is defaced with the air set to exactly zero; MRIQC's QI2 needs air noise, gets NaN, crashes (and drops the subject's other IQMs).
- Already filed upstream: https://github.com/nipreps/mriqc/issues/1402 (also seen on OpenNeuro ds006688)
- No MRIQC flag skips QI2. Zeroed air is not visible by eye; it is a numeric per-dataset fact (zero fraction / empty edge faces). Could be that we need a set of preflight checks, including script(s) and a visual check (#22).

MRIQC 24.0.2 on `sub-M2001 ses-1076` (the first eligible session at `--limit 1`) dies after ~7 min in the anatomical IQMs:

```
File ".../mriqc/interfaces/anatomical.py", line 378, in _run_interface
qi2, out_file = art_qi2(imdata, airdata)
File ".../mriqc/qc/anatomical.py", line 497, in art_qi2
kde_skl = KernelDensity(kernel='gaussian', bandwidth=4.0).fit(modelx[:, np.newaxis])
...
ValueError: Input X contains NaN.
```

QI2 fits a density to the air-mask intensity histogram; with no air noise there is nothing to fit. The T1w (`acq-tfl3_run-4_T1w`, int16, no NaN) has 72 % exact-zero voxels against ~22 % for an unstripped head, and a mid-slice view shows scalp and skull present with exact-zero air outside them: a defaced head with the background zeroed, not a stripped brain. Not a resource fault: duct peak RSS 11.2 GB against 48 G.

Upstream: nipreps/mriqc#1402 (open; zero-background images, a commenter hit it on OpenNeuro ds006688) and nipreps/mriqc#1133 (closed; AFNI-refaced T1ws, 48 of 254 subjects, fine before refacing). Known, unfixed.

Seen once before on this dataset in the March 2026 one-subject demo (no log kept); this is the first preserved log. Unity, OpenNeuroStudies c5 shakeout, job `64132887_1`.

- [ ] whether other subjects fail the same way (a `--limit 1` failure is one subject)
- [ ] scan the 28 c5 first-pick T1ws for zero fraction / edge faces, to see whether this is one dataset or a class

Generated by Claude Code.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing job 64132887_1 for sub-M2001 ses-1076 with MRIQC 24.0.2 and --limit 1, then inspect the failure at anatomical.py:378 and qc/anatomical.py:497. Scan the 28 c5 first-pick T1ws for zero fractions and empty edge faces, and compare other subject failures. Done means the prevalence and affected class are established and the appropriate preflight-check scope is documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.