Closed raylinfordaruplab closed 7 months ago
We can provide a sample file, but it's too large to upload here.
Thank you for your message! To be honest, the DICOM WSI format has not been implemented yet. The library currently handles the file as a regular DICOM file. However, implementing the WSI format should not be a major issue, and I will prioritize it. The implementation is expected to take up to a month, as most of the code has already been developed. I will provide a more precise estimation in the coming days.
Do you have a detailed description of the format? I found some information on the internet, but it does not cover all the details required for the implementation.
I also have a question for you. Is your slide represented by a single file or a directory? According to the format description I found, a WSI DICOM slide is typically represented by a directory with multiple files that correspond to different zoom levels.
I may need you to upload the file. Could you please let me know its size?
We have a single zstack example that is just over 1 GB in a single file. I believe we'll be able to provide a multi-zstack example shortly. What would be the best way to get the files to you?
Online service https://wetransfer.com/ allows to send files up to 2 GB for free. I have not tried it yet. Would you agree to try? Otherwise, I'll look for another option. You will need my email: stanislav.melnikov@gmail.com Thank you!
I sent it. When I have the other set, I'll let you know.
Thank you for the file! It looks like it is one file from the WSI slide. Normally, a WSI slide should have multiple zoom levels. Here is an example:
H01EBB50P-24777_label.dcm H01EBB50P-24777_level-0.dcm H01EBB50P-24777_level-1.dcm H01EBB50P-24777_level-2.dcm H01EBB50P-24777_level-3.dcm H01EBB50P-24777_level-4.dcm H01EBB50P-24777_level-5.dcm H01EBB50P-24777_level-6.dcm H01EBB50P-24777_level-7.dcm H01EBB50P-24777_level-8.dcm H01EBB50P-24777_localizer.dcm H01EBB50P-24777_macro.dcm
Each of the *_level-x.dcm files represents a zoom level of the slide. Multiple zoom levels allow for easy rendering of any magnification of the image. Do you have the rest of the files? This does not impede development, as I have found some complete examples of WSI files. If you have only a single level of the WSI slide, you will still be able to read arbitrary regions of the slide, but you may encounter performance issues if you want to render the entire slide or a portion of the slide with significant downsampling.
The dicom format does allow for the multiple zoom levels as you've described. The scanner that we are working with only outputs the level 0 file, however. Also in my own testing, with the files we have received, the "label" and "macro" files have been identical to the "level" files, as far as the image data format and image-specific metadata is concerned. That means I've been able to use the much smaller label file for my local testing, which has been faster for small tests.
Well, each zoom level is a separate DICOM dataset. I have some Whole Slide Imaging (WSI) slides with multiple zoom levels in separate files. You can check here. Maybe it is just scanner settings that produce an image pyramid.
Anyway, the performance without an image pyramid should be OK as long if you read original scale tiles or downsample them by not more than 4x. Bigger downsampling results in worse performance.
From your message, I understand that your're intersted in reading of tiles of original scale. Is it correct?
Thanks for your help! I'm starting the implementation today.
That is mostly correct. The actual ML process that will be consuming the WSIs will be using the original scale. We do have a separate application to allow viewing and browsing the slides, and we are doing some tiling at zoomed out scales for that application. If the performance at greater downsampling is a major issue, then we can work with the scanner to try and provide those zoom levels' files as well.
I have just completed the initial implementation for reading DICOM WSI images. Could I ask you to test it with your images? You can download the wheel files for Linux from this link, and for Windows and Mac (x64) from this link. Please let me know if you require the wheel files for Mac arm, as they are hosted on another CI server. Please let me know if performance is acceptable for you.
FYI: I'm working on tutorials for the library. Here is jupyter notebook for the DICOM images: https://github.com/Booritas/slideio-tutorial/blob/dicom/dicom.ipynb (still in progress, not yet merged to the master branch).
We are running on Mac arm processors.
What version of pythton do you use?
3.9.6. and mildewey was able to test it in a docker container (how we will actually be using it, most of the time). And it seems promising.
Our testing with our tiling process seems to be going well. Tiling a large image at different sizes, at different scales. The scaling appears to be working, and the processing time appears to be scaling relatively linearly for scales at 1/8 and lower.
Thank you for your feedback. Here is the wheel file for Mac Arm processors. Let me know if you have any problem. slideio-2.4.0-cp39-cp39-macosx_11_0_arm64.whl.zip
I just uploaded a new version 2.4.1 that includes support for DICOM WSI files
We are working with .dcm files of WSIs that slideio is not interpreting correctly. The pixel information is stored as an array of data frames that each represent a 256x256 tile of the overall image. Slideio currently only reads the first frame from the pixel data and treats it as if that is the entire slide. The file is still only one "scene" , but the scene is composed of an array of multiple "frames". The creator of the file is using the dicom metadata to indicate the structure like this:
We've been able to use highdicom to access the image data, but it is much slower than slideio, and we'd like to keep using slideio as our main WSI-handling library.
Looking into the slideio code, it seems like the issue might be that the number of frames is assumed to be 1 and for dicom files it isn't read from the metadata?