Project-MONAI / MONAI

AI Toolkit for Healthcare Imaging
https://monai.io/
Apache License 2.0
5.93k stars 1.09k forks source link

ITK 5.3.0 may break switch_endianness #5603

Closed mingxin-zheng closed 2 years ago

mingxin-zheng commented 2 years ago

Describe the bug ITK 5.2.1.post -> 5.3.0 may cause the following error in the freshly-built MONAI docker container.

2022-11-28 13:55:51,873 - INFO - set logging properties based on config: /workspace/bundles/monai_swin_unetr_btcv_segmentation_v0.3.9/configs/logging.conf.
^MLoading dataset:   0%|          | 0/21 [00:00<?, ?it/s]^MLoading dataset:   0%|          | 0/21 [00:07<?, ?it/s]
Traceback (most recent call last):
  File "/opt/conda/lib/python3.8/site-packages/monai/transforms/transform.py", line 91, in apply_transform
    return _apply_transform(transform, data, unpack_items)
  File "/opt/conda/lib/python3.8/site-packages/monai/transforms/transform.py", line 55, in _apply_transform
    return transform(parameters)
  File "/opt/conda/lib/python3.8/site-packages/monai/transforms/io/dictionary.py", line 154, in __call__
    data = self._loader(d[key], reader)
  File "/opt/conda/lib/python3.8/site-packages/monai/transforms/io/array.py", line 271, in __call__
    meta_data = switch_endianness(meta_data, "<")
  File "/opt/conda/lib/python3.8/site-packages/monai/transforms/io/array.py", line 84, in switch_endianness
    data = {k: switch_endianness(v, new) for k, v in data.items()}
  File "/opt/conda/lib/python3.8/site-packages/monai/transforms/io/array.py", line 84, in <dictcomp>
    data = {k: switch_endianness(v, new) for k, v in data.items()}
  File "/opt/conda/lib/python3.8/site-packages/monai/transforms/io/array.py", line 86, in switch_endianness
    raise RuntimeError(f"Unknown type: {type(data).__name__}")
RuntimeError: Unknown type: itkMatrixF44

To Reproduce Steps to reproduce the behavior:

  1. Build the docker image
  2. Run the spleen_deepedit and swin_unetr_btcv bundles

Note This issue is discovered by someone else when trying the MONAI with bundle. I didn't verify the issue myself.

mingxin-zheng commented 2 years ago

@wyli @Nic-Ma for visibility

wyli commented 2 years ago

It's a known issue, has been addressed recently https://github.com/Project-MONAI/MONAI/issues/5432 #5433. The patch is available on the Dev branch as well as monai-weekly, and will be included in monai 1.1 and onward