QIICR / QuantitativeReporting

Segmentation-based measurements with DICOM import and export of the results.
https://qiicr.gitbooks.io/quantitativereporting-guide
Other
23 stars 23 forks source link

Segmentations showing up for unrelated studies #271

Closed giuliabaldini closed 1 year ago

giuliabaldini commented 1 year ago

Hi there,

thank you very much for this extension, we are using it to look at our generated segmentations and it works very well! I currently have a problem, but I am not sure if it has to do with me setting the DICOM tags wrong, or if there is a bug somewhere.

The problem is that if I add more than one study to the DICOM viewer, segmentations from different studies get overlapped, even if they belong to different studies.

So my setup is the following:

Any idea of why this happens and how I could prevent it?

Thank you very much for your time.

Best, Giulia

lassoan commented 1 year ago

Segmentations have references to the source series and if you chose to always load references series then they will bo loaded automatically. If some unexpected series are loaded then it means that some IDs are not generated correctly (for example, some UIDs are hardcoded or reused). Make sure that all study instance UID, series instance UID, and SOP instance UID are unique. If you still have issues then share the DICOM files with us so that we can investigate. You can upload the files anywhere and post the link here. Make sure patient health information is not shared.

pieper commented 1 year ago

Also note that segmentations are associated with images that were used to create them based on DICOM header metadata, once they are loaded into Slicer they are displayed by default together with whatever other data is loaded. This allows you to do things like compare different subjects or perform registrations, etc.

If you want to show a particular image/segmentation pair in a particular slice view, you can drag-and-drop from the Data list into the slice view you want to view them in.

giuliabaldini commented 1 year ago

Hey, thank you very much for your answers.

@lassoan: I have already checked and Study/Series/SOP Instance UIDs are actually all different, which is also why in the "Add DICOM Data" window they are shown correctly.

image image

The examples I have are from TCIA and I have to figure out if I can upload them.

How do you generate SEGs to test with your program? Do you use dcmqi?

@pieper So if I understand correctly what you are describing, the behaviour I get is actually the expected behaviour. The weird thing is that depending on the order in which I import them into the viewer, I can either see one segmentation or two. So if I import two folders with DICOMS:

The first folder I imported: image

The second one I imported: image

pieper commented 1 year ago

Yes, it is expected behavior that segmentations will all be shown as they are loaded, but only the most recent CT will display. You can use the "eye" icons to toggle them.

Since they are from TCIA you can share them. If you don't mind post in your SEGs too and describe how you created them then I think we can help.

fedorov commented 1 year ago

@giuliabaldini it would be most efficient if you could share the dataset so we can reproduce the issue. It is quite difficult to understand what is going on otherwise, and we will need to spend a lot of time to figure this out in this thread.

giuliabaldini commented 1 year ago

Hi there, I have uploaded the TCIA data and the segmentations here: https://cloud.uk-essen.de/d/214ca09d350c4e4a88a8/. The link is only available for a week, and please do not share the segmentations. There is a folder data which contains two folders with the DICOM images: case_001 and case_050. Each folder has a respective nifti case_X_seg.nii.gz. The DICOM-segs case_X_seg.dcm were generated using dcmqi.sh. In the root folder, I have also provided the dcmqi.sh file and the itkimage2segimage binary version dcmqi-1.2.4-mac (for MacOS).

In 3DSlicer: I do "Import DICOM files" and choose data or I drag and drop the data folder with the DICOMs into the window. I understand that I could use the "eye" as mentioned by @pieper to make the other segmentation disappear, but if many segmentations (and many studies) are imported it gets very confusing, as they all show up at the same time. I would have expected that only the segmentations with the matching StudyInstanceUID show up in the window.

fedorov commented 1 year ago

@giuliabaldini I tried your sample with Slicer 5.3.0-2023-03-27 on Mac, and everything seems to work as expected. When I open a single study, I only see the image and segmentation from that study, see https://app.screencast.com/aafHnwuQEqrga. I also tried with Slicer 5.2.1, since this is the version you seem to be using, but again double-click on a study loaded only the image series and segmentation from that study.

Are you sure you are not loading one study after another by double-clicking each one? Note that if you do this, previous study will remain loaded in the scene.

giuliabaldini commented 1 year ago

@fedorov thank you for trying it out! The only thing I did differently from you was not "closing the scene" between using different studies, and by doing that I also get the same result as you do, so it is just the expected behaviour. I am used to other viewers which always open a different window I think, so that is why I was confused, but I also get the use case of having a segmentation for multiple studies for registration.

Thank you very much, I am closing the issue!

fedorov commented 1 year ago

Ah, makes sense - indeed, in this sense, Slicer is different. Glad we resolved this relatively quickly, and that QuantitativeReporting and dcmqi are helping you!

lassoan commented 1 year ago

Inability to compare data between patients (some cannot even show data of the same patient from multiple studies) is a common limitation of clinical viewers. Slicer can spatially register (with rigid alignment or warping) from multiple studies or patients and display, process, analyze them together.