Skip to content

[BUG] DICOMDataLoaderOperator crashes when reading non-DICOM files #266

@mocsharp

Description

@mocsharp

Describe the bug
DICOMDataLoaderOperator crashes when trying to read a non-DICOM file.

Steps/Code to reproduce bug

! monai-deploy exec examples/apps/dicom_series_to_image_app/app.py -i [path-to-dicom-and-non-dicom-files] -o output

Traceback (most recent call last):
  File "/home/aaaaa/miniconda3/bin/monai-deploy", line 8, in <module>
   ...
  File "/home/aaaaa/miniconda3/lib/python3.8/site-packages/pydicom/filereader.py", line 623, in read_preamble
    raise InvalidDicomError("File is missing DICOM File Meta Information "
pydicom.errors.InvalidDicomError: File is missing DICOM File Meta Information header or the 'DICM' prefix is missing from the header. Use force=True to force reading.

Expected behavior
THe operator shall ignore and log non-DICOM files.

Environment details (please complete the following information)

  • OS/Platform: linux, windows
  • Python Version: 3.8.x
  • Method of MONAI Deploy App SDK install: [pip, conda, Docker, or from source] source
  • SDK Version: 0.2.1

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