Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get error when reading dicom series with itk backend #6942

Closed
KumoLiu opened this issue Sep 5, 2023 · 0 comments · Fixed by #6943
Closed

Get error when reading dicom series with itk backend #6942

KumoLiu opened this issue Sep 5, 2023 · 0 comments · Fixed by #6943
Assignees
Labels
bug Something isn't working

Comments

@KumoLiu
Copy link
Contributor

KumoLiu commented Sep 5, 2023

Describe the bug
When reading the dicom series with LoadImage(itk backend) in MONAI transforms, it reported a bug shown below.
It only shows errors when there is only one file in the folder.

HDF5-DIAG: Error detected in HDF5 (1.12.1) thread 0:
  #000: [/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Fdeprec.c](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f62756e646c65222c2273657474696e6773223a7b22686f7374223a227373683a2f2f79756e6c69754031302e31392e3138332e3831227d7d.vscode-resource.vscode-cdn.net/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Fdeprec.c) line 156 in itk_H5Fis_hdf5(): unable to determine if file is accessible as HDF5
    major: File accessibility
    minor: Not an HDF5 file
  #001: [/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5VLcallback.c](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f62756e646c65222c2273657474696e6773223a7b22686f7374223a227373683a2f2f79756e6c69754031302e31392e3138332e3831227d7d.vscode-resource.vscode-cdn.net/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5VLcallback.c) line 3769 in itk_H5VL_file_specific(): file specific failed
    major: Virtual Object Layer
    minor: Can't operate on object
  #002: [/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5VLcallback.c](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f62756e646c65222c2273657474696e6773223a7b22686f7374223a227373683a2f2f79756e6c69754031302e31392e3138332e3831227d7d.vscode-resource.vscode-cdn.net/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5VLcallback.c) line 3699 in H5VL__file_specific(): file specific failed
    major: Virtual Object Layer
    minor: Can't operate on object
  #003: [/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5VLnative_file.c](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f62756e646c65222c2273657474696e6773223a7b22686f7374223a227373683a2f2f79756e6c69754031302e31392e3138332e3831227d7d.vscode-resource.vscode-cdn.net/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5VLnative_file.c) line 384 in itk_H5VL__native_file_specific(): error in HDF5 file check
    major: File accessibility
    minor: Unable to initialize object
  #004: [/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Fint.c](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f62756e646c65222c2273657474696e6773223a7b22686f7374223a227373683a2f2f79756e6c69754031302e31392e3138332e3831227d7d.vscode-resource.vscode-cdn.net/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5Fint.c) line 1086 in itk_H5F__is_hdf5(): error while trying to locate file signature
    major: File accessibility
    minor: Not an HDF5 file
  #005: [/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5FDint.c](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f62756e646c65222c2273657474696e6773223a7b22686f7374223a227373683a2f2f79756e6c69754031302e31392e3138332e3831227d7d.vscode-resource.vscode-cdn.net/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5FDint.c) line 113 in itk_H5FD_locate_signature(): unable to read file signature
    major: Low-level I/O
    minor: Unable to initialize object
  #006: [/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5FDint.c](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f62756e646c65222c2273657474696e6773223a7b22686f7374223a227373683a2f2f79756e6c69754031302e31392e3138332e3831227d7d.vscode-resource.vscode-cdn.net/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5FDint.c) line 189 in itk_H5FD_read(): driver read request failed
    major: Virtual File Layer
    minor: Read failed
  #007: [/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5FDsec2.c](https://vscode-remote+attached-002dcontainer-002b7b22636f6e7461696e65724e616d65223a222f62756e646c65222c2273657474696e6773223a7b22686f7374223a227373683a2f2f79756e6c69754031302e31392e3138332e3831227d7d.vscode-resource.vscode-cdn.net/work/ITK-source/ITK/Modules/ThirdParty/HDF5/src/itkhdf5/src/H5FDsec2.c) line 755 in H5FD__sec2_read(): file read failed: time = Tue Sep  5 05:46:15 2023
, filename = '/', file descriptor = 65, errno = 21, error message = 'Is a directory', buf = 0x7fffd2e1da68, total read size = 8, bytes this sub-read = 8, bytes actually read = 18446744073709551615, offset = 0
    major: Low-level I/O
    minor: Read failed

To Reproduce
Steps to reproduce the behavior:

  1. Install the MONAI dev branch.
  2. Download the attachment dcm file whose md5 is f511acb750076c56ad2d9647dcfe521d, put it in a folder.
  3. Run
from monai.transforms import LoadImage
loader = LoadImage()
loader('./test_data')

Expected behavior
itk can read dicom series successfully.

@KumoLiu KumoLiu added the bug Something isn't working label Sep 5, 2023
@KumoLiu KumoLiu self-assigned this Sep 5, 2023
KumoLiu added a commit to KumoLiu/MONAI that referenced this issue Sep 5, 2023
Signed-off-by: KumoLiu <yunl@nvidia.com>
@wyli wyli closed this as completed in #6943 Sep 5, 2023
wyli pushed a commit that referenced this issue Sep 5, 2023
Fixes #6942
fixes #6944.

### Description
When using itk backend reading dicom series and there is only one file
in the folder, return the first name since itk assuming that there must
be more than one file in the tuple.

https://github.com/InsightSoftwareConsortium/ITK/blob/452cb3f9716e95532200de3196d51cd705a0ec5e/Wrapping/Generators/Python/itk/support/extras.py#L1275-L1284

### Types of changes
<!--- Put an `x` in all the boxes that apply, and remove the not
applicable items -->
- [x] Non-breaking change (fix or new feature that would not break
existing functionality).
- [ ] Breaking change (fix or new feature that would cause existing
functionality to change).
- [ ] New tests added to cover the changes.
- [ ] Integration tests passed locally by running `./runtests.sh -f -u
--net --coverage`.
- [ ] Quick tests passed locally by running `./runtests.sh --quick
--unittests --disttests`.
- [ ] In-line docstrings updated.
- [ ] Documentation updated, tested `make html` command in the `docs/`
folder.

---------

Signed-off-by: KumoLiu <yunl@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant