Closed
Description
Describe the bug
Missing reader for nii.gz images
To Reproduce
Steps to reproduce the behavior:
- Run this notebook
Pre Processing
fails with:
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
/tmp/ipykernel_2246/4005805290.py in <module>
30 for t in pre_transforms:
31 tname = type(t).__name__
---> 32 data = t(data)
33 image = data['image']
34 label = data.get('label')
/opt/conda/lib/python3.7/site-packages/monai/transforms/io/dictionary.py in __call__(self, data, reader)
119 d = dict(data)
120 for key, meta_key, meta_key_postfix in self.key_iterator(d, self.meta_keys, self.meta_key_postfix):
--> 121 data = self._loader(d[key], reader)
122 if self._loader.image_only:
123 if not isinstance(data, np.ndarray):
/opt/conda/lib/python3.7/site-packages/monai/transforms/io/array.py in __call__(self, filename, reader)
199 if img is None or reader is None:
200 raise RuntimeError(
--> 201 f"can not find a suitable reader for file: {filename}.\n"
202 " Please install the reader libraries, see also the installation instructions:\n"
203 " https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies.\n"
RuntimeError: can not find a suitable reader for file: ('_image.nii.gz',).
Please install the reader libraries, see also the installation instructions:
https://docs.monai.io/en/latest/installation.html#installing-the-recommended-dependencies.
The current registered: [<monai.data.image_reader.ITKReader object at 0x7f123bcb70d0>, <monai.data.image_reader.NumpyReader object at 0x7f123bcb7110>, <monai.data.image_reader.PILReader object at 0x7f123bcb7190>, <monai.data.image_reader.NibabelReader object at 0x7f123bcb71d0>].
Expected behavior
It should be possible to run this cell.
Environment (please complete the following information):
- OS
$ cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
- Python version
Python 3.7.10
- MONAI version [e.g. git commit hash]
0.8.dev2143
7964d45b3f4fc0323561522462c6fbacc882a3ea
Additional context
Installing all MONAI dependencies fixed the issue:
pip install -q "monai-weekly[all]"
---
LoadImaged => image shape: (392, 392, 210)
Guidance: [[[145, 66, 180], [105, 66, 180]], []]; Slice Idx: 145
AsChannelFirstd => image shape: (210, 392, 392)
Guidance: [[[145, 66, 180], [105, 66, 180]], []]; Slice Idx: 145
<snip>
Metadata
Metadata
Assignees
Labels
No labels