Hi everyone,
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.826.0.1.3680043.2.146.2.20.3103689.1600244093.0"
> Study Added
> Need to insert new series: "1.3.12.2.1107.5.6.1.2013.31330116120712460953700001577"
> Series Added
> "DICOM indexer has successfully processed 130 files [0.95s]"
The series can also be retrieved:
slicer.dicomDatabase.seriesForStudy(studyList[0])
> ('1.3.12.2.1107.5.6.1.2013.31330116120712460953700001577',)
To load the series, I use:
seriesInstanceUID = '1.3.12.2.1107.5.6.1.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(['1.3.12.2.1107.5.6.1.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!