Skip to content

e2e test scenarios: KeyError: 'nifti_affine_transform' in liver_seg #118

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

Closed
jordimassaguerpla opened this issue Feb 8, 2023 · 1 comment

Comments

@jordimassaguerpla
Copy link

Hi,

I set up a monai cluster following this instructions Project-MONAI/monai-deploy-workflow-manager#666 . In order to test it, I am using this clinical workflow from the e2e test scenarios https://github.com/Project-MONAI/monai-deploy/blob/main/e2e-testing/test-scenarios/Clinical_Workflows/liver_seg.json.

I download the images from this Medical Decathlon, as explained in https://github.com/Project-MONAI/monai-deploy/tree/main/deploy/monai-deploy-express#running-a-monai-deploy-workflow .

I rename the image work/monai-deploy-workflow-manager/deploy/examples/monai-deploy-lite-liver-ct/000587.dcm to input-dicom and uploaded this to Orthanc.

Then, I send the study to the Dicom modality and I get this error in the liver segmentation container:

Going to initiate execution of operator DICOMDataLoaderOperator
Executing operator DICOMDataLoaderOperator (Process ID: 25, Operator ID: e9628084-9846-44aa-b89
a-efb844fe1855)
[2023-02-08 13:36:52,828] [WARNING] (root) - Ignored /var/monai/input/1.2.826.0.1.3680043.2.112
5.1.19616861412188316212577695277886020/1.2.826.0.1.3680043.2.1125.1.34918616334750294149839565
085991567/1.2.826.0.1.3680043.2.1125.1.6173393152365463986791105716239686.dcm.json, reason bein
g: File is missing DICOM File Meta Information header or the 'DICM' prefix is missing from the
header. Use force=True to force reading.
Done performing execution of operator DICOMDataLoaderOperator

Going to initiate execution of operator DICOMSeriesSelectorOperator
Executing operator DICOMSeriesSelectorOperator (Process ID: 25, Operator ID: f6def06a-5cc6-4e0c
-9eaf-2c44340db6d9)
[2023-02-08 13:36:52,831] [INFO] (root) - Finding series for Selection named: CT Series
[2023-02-08 13:36:52,831] [INFO] (root) - Searching study, : 1.2.826.0.1.3680043.2.1125.1.19616
861412188316212577695277886020
  # of series: 1
[2023-02-08 13:36:52,831] [INFO] (root) - Working on series, instance UID: 1.2.826.0.1.3680043.
2.1125.1.34918616334750294149839565085991567
[2023-02-08 13:36:52,831] [INFO] (root) - On attribute: 'Modality' to match value: '(?i)CT'
[2023-02-08 13:36:52,831] [INFO] (root) -     Series attribute Modality value: CT
[2023-02-08 13:36:52,831] [INFO] (root) - Series attribute string value did not match. Try regE
x.
[2023-02-08 13:36:52,831] [INFO] (root) - On attribute: 'ImageType' to match value: '['PRIMARY'
, 'ORIGINAL']'
[2023-02-08 13:36:52,831] [INFO] (root) -     Series attribute ImageType value: None
[2023-02-08 13:36:52,831] [INFO] (root) - On attribute: 'PhotometricInterpretation' to match va
lue: 'MONOCHROME2'
[2023-02-08 13:36:52,831] [INFO] (root) -     Series attribute PhotometricInterpretation value:
 None
[2023-02-08 13:36:52,831] [INFO] (root) - Selected Series, UID: 1.2.826.0.1.3680043.2.1125.1.34
918616334750294149839565085991567
Done performing execution of operator DICOMSeriesSelectorOperator

Going to initiate execution of operator DICOMSeriesToVolumeOperator
Executing operator DICOMSeriesToVolumeOperator (Process ID: 25, Operator ID: 5036c2da-fcc6-4f9a
-abf8-a59b70c28dd6)
Done performing execution of operator DICOMSeriesToVolumeOperator

Going to initiate execution of operator LiverTumorSegOperator
Executing operator LiverTumorSegOperator (Process ID: 25, Operator ID: 0b577306-331d-48f7-a974-
9b462b54a155)
Operator output folder path: /var/monai/operators/0b577306-331d-48f7-a974-9b462b54a155/0/output
/saved_images_folder
Converted Image object metadata:
SeriesInstanceUID: 1.2.826.0.1.3680043.2.1125.1.34918616334750294149839565085991567, type <clas
s 'str'>
SeriesDate: 20201014, type <class 'str'>
SeriesTime: 162720, type <class 'str'>
Modality: CT, type <class 'str'>
SeriesDescription: CT series for liver tumor from nii 014, type <class 'str'>
PatientPosition: HFS, type <class 'str'>
SeriesNumber: 1, type <class 'int'>
row_pixel_spacing: 0.685546875, type <class 'float'>
col_pixel_spacing: 0.685546875, type <class 'float'>
depth_pixel_spacing: 1.0, type <class 'float'>
row_direction_cosine: [1.0, 0.0, 0.0], type <class 'list'>
col_direction_cosine: [0.0, 1.0, 0.0], type <class 'list'>
StudyInstanceUID: 1.2.826.0.1.3680043.2.1125.1.19616861412188316212577695277886020, type <class
 'str'>
StudyID: SLICER10001, type <class 'str'>
StudyDate: 20201014, type <class 'str'>
StudyTime: 162720, type <class 'str'>
StudyDescription: CT Study for liver_14, type <class 'str'>
AccessionNumber: 1, type <class 'str'>
selection_name: CT Series, type <class 'str'>
2023-02-08 13:36:52,872 INFO image_writer.py:193 - writing: /var/monai/operators/0b577306-331d-
48f7-a974-9b462b54a155/0/output/saved_images_folder/1.2.826.0.1.3680043.2.1125.1/1.2.826.0.1.36
80043.2.1125.1.nii.gz
2023-02-08 13:36:58,139 INFO image_writer.py:193 - writing: /var/monai/operators/0b577306-331d-
48f7-a974-9b462b54a155/0/output/saved_images_folder/1.2.826.0.1.3680043.2.1125.1/1.2.826.0.1.36
80043.2.1125.1_seg.nii.gz
Output Seg image numpy array shaped: (1, 512, 512)
Output Seg image pixel max value: 0
Done performing execution of operator LiverTumorSegOperator

Going to initiate execution of operator DICOMSegmentationWriterOperator
Executing operator DICOMSegmentationWriterOperator (Process ID: 25, Operator ID: e616ac55-6c84-
4e00-a535-f26243e0b670)
[2023-02-08 13:36:58,481] [WARNING] (highdicom.seg.sop) - Encoding an empty segmentation with "
omit_empty_frames" set to True. Reverting to encoding all frames since omitting all frames is n
ot possible.
[2023-02-08 13:36:58,482] [INFO] (highdicom.seg.sop) - add plane #0 for segment #1
[2023-02-08 13:36:58,483] [INFO] (highdicom.seg.sop) - add plane #0 for segment #2
[2023-02-08 13:36:58,484] [INFO] (highdicom.base) - copy Image-related attributes from dataset
"1.2.826.0.1.3680043.2.1125.1.6173393152365463986791105716239686"
[2023-02-08 13:36:58,484] [INFO] (highdicom.base) - copy attributes of module "Specimen"
[2023-02-08 13:36:58,484] [INFO] (highdicom.base) - copy Patient-related attributes from datase
t "1.2.826.0.1.3680043.2.1125.1.6173393152365463986791105716239686"
[2023-02-08 13:36:58,484] [INFO] (highdicom.base) - copy attributes of module "Patient"
[2023-02-08 13:36:58,485] [INFO] (highdicom.base) - copy attributes of module "Clinical Trial S
ubject"
[2023-02-08 13:36:58,485] [INFO] (highdicom.base) - copy Study-related attributes from dataset
"1.2.826.0.1.3680043.2.1125.1.6173393152365463986791105716239686"
[2023-02-08 13:36:58,485] [INFO] (highdicom.base) - copy attributes of module "General Study"
[2023-02-08 13:36:58,485] [INFO] (highdicom.base) - copy attributes of module "Patient Study"
[2023-02-08 13:36:58,485] [INFO] (highdicom.base) - copy attributes of module "Clinical Trial S
tudy"
Done performing execution of operator DICOMSegmentationWriterOperator

Going to initiate execution of operator STLConversionOperator
Executing operator STLConversionOperator (Process ID: 25, Operator ID: 42c57850-90f7-4eef-8b75-5a00f43a97b9)
[2023-02-08 13:36:58,495] [INFO] (monai.deploy.operators.stl_conversion_operator.STLConversionOperator) - Output will be saved in file /var/monai/output/stl/liver_seg.stl.
Traceback (most recent call last):
  File "/opt/monai/app/app.py", line 142, in <module>
    app_instance.run()
  File "/opt/monai/app/app.py", line 62, in run
    super().run(*args, **kwargs)
  File "/root/.local/lib/python3.8/site-packages/monai/deploy/core/application.py", line 429, in run
    executor_obj.run()
  File "/root/.local/lib/python3.8/site-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 "/root/.local/lib/python3.8/site-packages/monai/deploy/operators/stl_conversion_operator.py", line 95, in compute
    stl_bytes = self._convert(input_image, _output_file)
  File "/root/.local/lib/python3.8/site-packages/monai/deploy/operators/stl_conversion_operator.py", line 121, in _convert
    return self._converter.convert(
  File "/root/.local/lib/python3.8/site-packages/monai/deploy/operators/stl_conversion_operator.py", line 165, in convert
    s_image = self.SpatialImage(image)
  File "/root/.local/lib/python3.8/site-packages/monai/deploy/operators/stl_conversion_operator.py", line 297, in __init__
    self._read_from_in_mem_image(self._image)
  File "/root/.local/lib/python3.8/site-packages/monai/deploy/operators/stl_conversion_operator.py", line 394, in _read_from_in_mem_image
    img_array, affine, original_affine, shape, spacing, itk_image = self._load_data(image)
  File "/root/.local/lib/python3.8/site-packages/monai/deploy/operators/stl_conversion_operator.py", line 366, in _load_data
    original_affine = img_meta_dict["nifti_affine_transform"]
KeyError: 'nifti_affine_transform'

What am I doing wrong?

Thanks

@jordimassaguerpla
Copy link
Author

I just pushed all the dcm files in that zip instead of just on dcm file and I did not get the error!! Sorry, I am new to all this. Do I need all the 588 dcm files?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant