Skip to content

DICOMSeriesToVolumeOperator fails when DICOM instances do not have (0028, 1052), Rescale Intercept attribute #187

Closed
@MMelQin

Description

@MMelQin

Describe the bug
For an example DICOM CT series (likely converted into DICOM from NIfTI), where there is no tag (0028, 1052) Rescale Intercept, the DICOMSeriesToVolumeOperator fails as it does not handle the absence of this attribute, as seen from the log.

  File "/usr/local/lib/python3.6/dist-packages/monai/deploy/core/executors/single_process_executor.py", line 125, in run
    op.compute(op_exec_context.input_context, op_exec_context.output_context, op_exec_context)
  File "/usr/local/lib/python3.6/dist-packages/monai/deploy/operators/dicom_series_to_volume_operator.py", line 37, in compute
    voxel_data = self.generate_voxel_data(dicom_series)
  File "/usr/local/lib/python3.6/dist-packages/monai/deploy/operators/dicom_series_to_volume_operator.py", line 55, in generate_voxel_data
    intercept = slices[0][0x0028, 0x1052].value
  File "/usr/local/lib/python3.6/dist-packages/monai/deploy/core/domain/dicom_sop_instance.py", line 43, in __getitem__
    return self._sop.__getitem__(key)
  File "/usr/local/lib/python3.6/dist-packages/pydicom/dataset.py", line 916, in __getitem__
    elem = self._dict[tag]
KeyError: (0028, 1052)

Steps/Code to reproduce bug
Choose a series that is known without the said attribute

Expected behavior
The said operator should be able to handle the absence of attribute, treat it as 0.
This attribute, for CT, in the mandatory CT Image Modules is a mandatory attribute, but somehow the input DICOM series is missing this attribute. With it missing, it is safe to assume it being 0.

Environment details (please complete the following information)

  • OS/Platform: Ubuntu 18.04
  • Python Version: 3.7.5
  • Method of MONAI Deploy App SDK install: from source
  • SDK Version: v0.1

Additional context
See DICOM Standards Part3, or this page, https://dicom.innolitics.com/ciods/ct-image/ct-image/00281052

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions