Skip to content

Feat/nifti support#26

Open
sameeul wants to merge 4 commits intoPolusAI:mainfrom
sameeul:feat/nifti-support
Open

Feat/nifti support#26
sameeul wants to merge 4 commits intoPolusAI:mainfrom
sameeul:feat/nifti-support

Conversation

@sameeul
Copy link
Member

@sameeul sameeul commented Mar 6, 2026

No description provided.

sameeul and others added 4 commits February 21, 2026 09:36
Add NiftiReaderCPP C++ class and NiftiReader Python wrapper for reading
NIFTI-1 and NIFTI-2 format files. Uses direct file I/O + zlib for
decompression instead of TensorStore, following the same interface
convention as TsReaderCPP.

- Supports .nii (plain) and .nii.gz (gzip-compressed) files
- Auto-detects NIFTI-1 (348-byte header) and NIFTI-2 (540-byte header)
- Handles byte-swapped files
- Applies scl_slope/scl_inter scaling when present (returns float64)
- Exposes physical voxel size via pixdim[1..3]
- 14 unit tests covering shapes, pixel values, subregion reads,
  scaling, compressed files, physical size, and error handling

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant