InsightSoftwareConsortium / InsightSoftwareConsortium/ITK
Write to NRRD writes the wrong data type to the file
- Dominant language
- C++
- Stars
- 1.7k
- Forks
- 748
- Avg merge
- 1d 1h
- Merged PRs (30d)
- 64
Description
### Description
Writing images at NRRD files outputs the wrong type to the NRRD header.
### Steps to Reproduce
```py
import SimpleITK as sitk
image = ... # Create sitk image
print(img.GetPixelIDTypeAsString()) # '16-bit signed integer'
sitk.WriteImage(image, "test.nrrd")
```
### Expected behavior
```none
NRRD0004
...
type: int16
```
### Actual behavior
```none
NRRD0004
...
type: short
```
### Reproducibility
This happens 100% of the time for int16 data type, but likely happens with other data types as well.
### Versions
I am using [the latest Python SimpleITK wrapper](https://pypi.org/project/simpleitk/2.5.2/).
### Environment
Python 3.13 on RHEL 9.5
### Additional Information
I use `sed -e '/./!Q' /path/to/nrrd/file.nrrd` to read the NRRD header easily.
Contributor guide
Assessment
This issue has not been assessed yet.