Repository navigation
Commit 0e9fc83
test(nifti): cover 2D writer without target affine (#9173)
## Summary
Add a regression test for the public `NibabelWriter` path reported in
#9166.
The reported `TypeError` is already resolved on `dev` by the general
`spatial_resample` fix in #9080. This PR adds direct coverage for the
original writer-level scenario so the regression cannot return without
failing this test.
The new test writes a 2D channel-less array with `spatial_ndim=None`,
`original_affine=None`, and no `spatial_shape`, then verifies the saved
data and affine.
## Validation
- On `e28a2c07^`, the new test fails with the reported `TypeError: '>='
not supported between instances of 'NoneType' and 'int'`.
- On current `dev`, the new test passes.
- `python -m pytest tests/data/test_nifti_rw.py -q`: 42 passed
- `python -m pytest tests/transforms/test_spatial_resample.py -q`: 76
passed
- `python -m pytest tests/data/test_image_rw.py -q`: 2 passed, 28
skipped in the local minimal environment
- `ruff`, `black --check`, `isort --check-only`, and `git diff --check`:
passed
## AI disclosure
This contribution was prepared with Codex assistance and reviewed by the
submitter, who will respond to review comments personally.
Signed-off-by: peng xiang <78131130+px12811@users.noreply.github.com>
Co-authored-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com>1 parent 41df4d9 commit 0e9fc83
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
175 | 189 | | |
176 | 190 | | |
177 | 191 | | |
| |||
0 commit comments