InsightSoftwareConsortium / InsightSoftwareConsortium/ITK

Corrupted nifti image loading if same filename is used with different extensions in the same folder

Open
#2,243 8 comments 0 reactions 1 assignee Claimed by @seanm View on GitHub
type:Bug
Dominant language
C++
Stars
1.7k
Forks
748
Avg merge
1d 1h
Merged PRs (30d)
64

Description

### Description

NIFTI images are loaded with corrupted image data if loading something.nii.gz and there is another file with the same filename with .nii extension.

See original bug report of a user at https://github.com/Slicer/Slicer/issues/5378

### Steps to Reproduce

- Place A.nii and A.nii.gz files in the same folder (any two different nifti files work, but here is an example data set: https://1drv.ms/u/s!Arm_AFxB9yqHxO1XF9OyB_PYU3khTQ?e=TasE3z)
- Load A.nii.gz -> loaded image is corrupted

### Versions

ITK-5.1
(reproducible in various versions of Slicer, MITK, ITK-Snap, etc.)

### Environment

Windows, Linux

### Additional Information

It is just so frustrating that there are so many troubles with nifti images and people often keep using it (it only makes sense for neuroimaging but probably they should give up as well and move to a new, simpler and better format).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.