microsoft / InnerEye-DICOM-RT

DICOM-RT to mask python package used by https://github.com/microsoft/InnerEye-deeplearning
https://aka.ms/innereye
MIT License
8 stars 6 forks source link

Inferenced segmentation.dcm cannot be imported to Eclipse #6

Closed ant0nsc closed 2 years ago

ant0nsc commented 2 years ago

Discussed in https://github.com/microsoft/InnerEye-DeepLearning/discussions/687

Originally posted by **furtheraway** March 5, 2022 Hi all, I am walking through the model taining and inference with the example lung segamentation dataset https://github.com/microsoft/InnerEye-DeepLearning/blob/main/docs/sample_tasks.md The model training has succeed on Azure ML. Then I zip up the DICOM files of the second test subject into a zip file: C:\Users\xxxx\Downloads\IE_lung_dataset\manifest-1557326747206\LCTSC\LCTSC-Test-S1-102\11-04-2003-NA-RTRCCTTHORAX8FHigh Adult-20444\0.000000-CT114545RespCT 3.0 B30f 50 Ex-81163 `zip -r patS1102.zip 0.000000-CT114545RespCT\ \ 3.0\ \ B30f\ \ 50\ Ex-81163/` Then submit it with submit_for_inference.py: ``` python InnerEye/Scripts/submit_for_inference.py --image_file /home/xxxx/datasets/inference_dicom/patS1102.zip --model_id LungExample:1 --download_folder /home/xxxx/source/2022/download/ --use_dicom true ``` The inference run finished successfully and I got the segmentation.dcm file. But when I tried to import this segmentation.dcm file to Eclipse, I run into the following error: ![image](https://user-images.githubusercontent.com/7104230/156857012-e7adb451-7660-45c4-89ab-92f93f6cfe17.png) I can import the original DICOM files for this subject without any issue, @ant0nsc

AB#5453

ant0nsc commented 2 years ago

@peterhessey FYI

peterhessey commented 2 years ago

Additional details from previous e-mail chain:

"It looks like the problem is near the end of the file.

The dumps show the data twice, first as hex, then as ASCII. Each pair of lines is prefixed with the byte offset.

After the end of the file, the original file has extra 00 bytes, as shown in the snippets below. These were cut and pasted from the hex dump files and had the byte offset corrected.

If you want to test it, you can use DICOM+ to read it in and see if it shows any errors.

Original file:
1232651  65  74  65  72  5e  fe  ff  0d  e0  00  00  00  00  fe  ff  dd  e0  00  00  00  00  **00  00  00  00  00  00  00  00  00  00  00  00  00  00  00  00**
          e   t   e   r   ^   ~ del  cr   ` nul nul nul nul   ~ del   ]   ` nul nul nul nul **nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul nul**

Fixed file:
1232677  65  74  65  72  5e  fe  ff  0d  e0  00  00  00  00  fe  ff  dd  e0  00  00  00  00
          e   t   e   r   ^   ~ del  cr   ` nul nul nul nul   ~ del   ]   ` nul nul nul nul

"

It was recommended that the data between the pairs of asterisks (**) should be removed (asterisks added manually).

ant0nsc commented 2 years ago

Adding @furtheraway for visibility, who had originally posted the question