I am working on improving the loading of DICOM Structured Reports into Slicer using the QuantitativeReporting plugin. Some SRs could have multiple series that are referenced. However, when I choose to load the SR in the DICOM Browser, as an example, only 2 out of the 3 valid series are actually listed to be selected in the pop-up window. Additionally, sometimes they are listed as a scalar volume or as an image sequence. The series that are displayed in this pop-up window, and if they are a scalar volume or image sequence, change every time I open Slicer.
I know that these series could be a scalar volume or an image sequence, especially if they’re old, from this post.
Additionally, from my understanding, as seen in the DICOMBrowser loadCheckedLoadables function, I need to have a list of loadable.referencedInstanceUIDs. In my changes to QuantitativeReporting, I have also confirmed that the loadable.referencedInstanceUIDs contains all of the referenced SOPInstanceUIDs from the valid referenced series.
Therefore, I think that in an ideal case, the pop-up window should have the 3 series listed as scalar volumes, and then additionally listed as image sequences, for a total of 6 check boxes.
Am I missing something when creating the loadable.referencedInstanceUIDs list?
Yes, I did try to put some print statements in DICOMBrowser.py. In the loadCheckedLoadables I added statements to print the 1) referencedFileLists, and the 2) self.referencedLoadables from self.getLoadablesFromFileLists(referencedFileLists).
Here was my thought process:
From the referencedFileLists, I first checked that it contained the three unique SeriesInstanceUIDs, which it does.
I then checked that the number of SOPInstanceUIDs for each of the SeriesInstanceUIDs matches what I see in Slicer, which it does. (file_counts: [19, 19, 15])
I then checked the self.referencedLoadables to make sure the right plugins were being used for each loadable. This is where I can see a potential issue. The DICOMImageSequencePlugin has a list of 1 loadables, and DICOMScalarVolumePlugin has a list of 7 loadables. Shouldn’t self.referencedLoadables only contain 3 loadables?
A series can map to multiple loadables. You can confirm this by selecting just the series and clicking Examine to see what is detected and what is checked by default.
I’m thinking that in the loop referenced above at line 702 some of the loadables are not selected.
Yes you’re right, that some of the loadables are not selected. From the original list of 7 for DICOMScalarVolumePlugin, only 1 has loadable.selected=True.
@DeepaKrishnaswamy, first, I think we do not want all of the loadables to show up checked in that popup - only high confidence. Second, since this depends on your updates to QuantitativeReporting, I am not sure your updates correctly initialize the list of referenced instances - there may be duplicates, and I do not know how this is handled downstream, see comment here: Added code to import and display points, lines and bounding boxes by deepakri201 · Pull Request #287 · QIICR/QuantitativeReporting · GitHub. I think it makes sense to first make sure your implementation is correct. If you suspect Slicer has a bug, I recommend creating an example where you have a standalone script that can reproduce the issue outside that large PR above.