Booritas / slideio

BSD 3-Clause "New" or "Revised" License
49 stars 2 forks source link

Missing DICOM scenes #15

Closed ChristianMarzahl closed 1 year ago

ChristianMarzahl commented 1 year ago

Dear @Booritas,

Thank you very much for this helpful repository.

Observation

When using SlideIO with google COLAB, only two scenes are loaded from a DICOM folder.

H01EBB50P-24777/crc_checksum.json  
H01EBB50P-24777/H01EBB50P-24777_label.dcm  
H01EBB50P-24777/H01EBB50P-24777_level-0.dcm  
H01EBB50P-24777/H01EBB50P-24777_level-1.dcm  
H01EBB50P-24777/H01EBB50P-24777_level-2.dcm  
H01EBB50P-24777/H01EBB50P-24777_level-3.dcm  
H01EBB50P-24777/H01EBB50P-24777_level-4.dcm  
H01EBB50P-24777/H01EBB50P-24777_level-5.dcm  
H01EBB50P-24777/H01EBB50P-24777_level-6.dcm  
H01EBB50P-24777/H01EBB50P-24777_level-7.dcm  
H01EBB50P-24777/H01EBB50P-24777_level-8.dcm  
H01EBB50P-24777/H01EBB50P-24777_localizer.dcm  
H01EBB50P-24777/H01EBB50P-24777_macro.dcm  
import slideio

slide = slideio.open_slide(str("H01EBB50P-24777"), driver="DCM")
scene_paths = {Path(slide.get_scene(scene_id).file_path) : slide.get_scene(scene_id) 
                                for scene_id in range(slide.num_scenes)} 
scene_paths
PosixPath('H01EBB50P-24777/H01EBB50P-24777_label.dcm'): <slideio.py_slideio.Scene at 0x7fd59146ce50>,
PosixPath('H01EBB50P-24777/H01EBB50P-24777_macro.dcm'): <slideio.py_slideio.Scene at 0x7fd59146c6d0>

The SlideIO lib is unable to load any levels. On a Windows operating system, the same DICOM folder is processed correctly.

Environment

OS: Linux (Ubuntu)

slideio-2.0.6

Minimal Reproducible Example

I created a Notebook to reproduce the issue on COLAB

With kind regards, Christian

Booritas commented 1 year ago

Dear Christian, thanks a lot for the example. Indeed, the example in the COLAB notebook behaves strange. I will investigate the case ASAP. I'll let you know as soon as I have more information.

BTW, the directory represents a DICOM WSI image. Supporting such format is in my queue. Would it be useful for you to handle the directory as a single file? In this case, the library will take care about different zoom levels. Best regards, Stanislav

ChristianMarzahl commented 1 year ago

Dear @Booritas,

Thank you very much for looking into this. If I can be of any assistance, please let me know.

Supporting the DICOM directory as a single file would be helpful in the future, but currently, the library is already beneficial for us.

With kind regards, Christian

Booritas commented 1 year ago

Hello Christian,

It seems that you encountered an issue with the library resulting in only 2 scenes instead of the expected 12. The problem arose because the library attempts to sort all files in the directory by Series UID in order to construct a 3D volume. However, since all files in the directory belong to the same series, the library mistakenly tried to build a volume from images of the same size, which is not appropriate for WSI DICOM slides.

To address this issue, I have implemented a check to ensure correct behavior. With the latest version of the library (2.0.8), you should now be able to obtain the correct 12 scenes as expected. Please upgrade to the latest version to resolve this issue.

Best regards, Stanislav

ChristianMarzahl commented 1 year ago

Dear @Booritas ,

On the COLAB the results look good now. Thank you very much for looking into the issue and fixing it.

With kind regards, Christian