I’m trying to load DICOM files to scene (within a headless CI-pipeline) by using
DICOMUtils.loadSeriesByUID, as linked here.
However, trying to load the scene fails, although no error is thrown.
Importing the files to the db works, using
DICOMUtils.importDicom, as linked here.
> New patient inserted: 1 > New patient inserted as : 1 > Need to insert new study: "1.2.818.104.22.16880043.2.146.2.20.3103689.1600244093.0" > Study Added > Need to insert new series: "22.214.171.124.1126.96.36.199.2013.31330116120712460953700001577" > Series Added > "DICOM indexer has successfully processed 130 files [0.95s]"
The series can also be retrieved:
slicer.dicomDatabase.seriesForStudy(studyList) > ('188.8.131.52.1184.108.40.206.2013.31330116120712460953700001577',)
To load the series, I use:
seriesInstanceUID = '220.127.116.11.118.104.22.168.2013.31330116120712460953700001577' ok = utils.loadSeriesByUID([seriesInstanceUID])
The loading does not throw an error, but shows this warning:
> Warning in DICOM plugin Scalar Volume when examining loadable <SeriesName>: Images are not equally spaced (a difference of 3 vs 3 in spacings was detected). If loaded image appears distorted, enable 'Acquisition geometry regularization' in Application settings / DICOM / DICOMScalarVolumePlugin. Please use caution.
The function returns
True, although this seems to be the case even if you import a seriesUID with an invalid UID:
utils.loadSeriesByUID(['22.214.171.124.1126.96.36.199.2013.31330116120712460953700001577']) > True utils.loadSeriesByUID(['an invalid seriesUID']) > True
Either way, after the loading, there are no child items attached to the scene:
shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene) sceneID = shNode.GetSceneItemID() items = vtk.vtkIdList() shNode.GetItemChildren(sceneID, items) items.GetNumberOfIds() > 0
Is this behaviour linked with the newest announcements of decoupling the widget from the logic?
Does anyone have a clue why my approach does not work?
Thanks in advance for any feedback!