Skip to content

Get error when reading dicom series with itk backend #6942

Closed
@KumoLiu

Description

@KumoLiu

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.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions