con / con/mechababs

ds005752: MRIQC dies on a T2w with "inhomogeneity-corrected data seem empty" (nipreps/mriqc#1406)

Open
#152 0 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

## asmacdo tldr:
- For some T2w, if the contrast is insufficient, the WM mask is empty and the NaNs propagate down the pipeline until MRIQC fails.
- Already filed upstream: https://github.com/nipreps/mriqc/issues/1406
- One possible workaround is to disable T2w for datasets where we see it (`-m T1w bold`), but it is per-subject, not per-dataset, see below.

Useful comments upstream: jbwexler saw it on ds005603 ds003814 ds004712 ds005576 ds003691 ds005464 ds005003 ds004627 ds005237 ds004856 ds004466 ds003836 ds005386 (https://github.com/nipreps/mriqc/issues/1406#issuecomment-3211489799) and noted "all of these besides ds003691 contain T2w images" (https://github.com/nipreps/mriqc/issues/1406#issuecomment-3211650407). ds005237 is on that list and passed for us, but only its first job, so a dataset that passes one subject can fail the next.

## Claude explanation

MRIQC 24.0.2 on ds005752 `sub-ON00400 ses-01` (the first eligible session at `--limit 1`) crashes in the anatomical IQMs on the plain T2w, `acq-CUBE_T2w`:

```
File ".../mriqc/interfaces/anatomical.py", line 116, in _run_interface
RuntimeError: Input inhomogeneity-corrected data seem empty. MRIQC failed to process this dataset.
```

The T2w is a normal image (float32, no NaN or negatives, noise to the volume faces). The message is misleading: `Harmonize` rescales the image by the median inside Atropos's WM mask thresholded at probability 0.9, and a T2w whose WM never reaches 0.9 gives an empty mask, a NaN median, and an all-NaN volume that the next check reports as empty. Segmentation confidence is what failed. The T2w poor-contrast report under nipreps/mriqc#1318 describes the same mechanism.

Data-dependent, not systematic: five other c5 datasets with T2w files (ds004078, ds005165, ds005237, ds005896, ds007116) ran MRIQC through at one subject each. ds002766 `sub-cast3 ses-03` failed with the same message in August 2026 (modality not recorded then).

The cost is larger than one T2w: MRIQC crashes without exporting the subject's T1w IQMs (nipreps/mriqc#1402), so a bad T2w loses the whole subject's anatomical QC.

Options, undecided:
- `-m T1w bold` campaign-wide: no T2w QC anywhere, no crashes from it.
- accept: the cell fails, the subject has no MRIQC output, the failure is upstream-known.
- per-dataset override: the config-per-member question is open in the spec.

Unity, OpenNeuroStudies c5 shakeout, job `64133152_1`, 15 min, duct peak RSS 34.7 GB.

Generated by Claude Code.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the upstream MRIQC issue #1406 and the failure described for `mriqc/interfaces/anatomical.py`; the issue identifies an empty WM mask during T2w harmonization as the failure mechanism. Review the linked upstream reports and the three proposed options, which remain undecided here. Done is not defined until a resolution is chosen.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.