Summary
fMRIPrep contains two general-purpose image math interfaces in `fmriprep/interfaces/maths.py`:
`Clip` (lines 21-52)
Clips NIfTI image values to a specified min/max range. If no values are outside bounds, passes through without copying.
`Label2Mask` (lines 64-84)
Extracts a binary mask from a multi-label segmentation for a specific label value.
Both are completely general image operations with no fMRI specificity. They could live in `niworkflows.interfaces.nibabel` or a new `niworkflows.interfaces.maths` module.
Code to upstream
- `Clip` in `fmriprep/interfaces/maths.py`
- `Label2Mask` in `fmriprep/interfaces/maths.py`
Rationale
- General-purpose NIfTI manipulation needed by any tool working with parametric maps or segmentation labels
- Used in fMRIPrep's T2* reporting but applicable across modalities
Priority
MEDIUM.
Summary
fMRIPrep contains two general-purpose image math interfaces in `fmriprep/interfaces/maths.py`:
`Clip` (lines 21-52)
Clips NIfTI image values to a specified min/max range. If no values are outside bounds, passes through without copying.
`Label2Mask` (lines 64-84)
Extracts a binary mask from a multi-label segmentation for a specific label value.
Both are completely general image operations with no fMRI specificity. They could live in `niworkflows.interfaces.nibabel` or a new `niworkflows.interfaces.maths` module.
Code to upstream
Rationale
Priority
MEDIUM.