When use a self-build verison slicer (the latest slicer code and source code version: Slicer-88f0c40fa19d00616ba984abd0512e540a974525), I found I cannot get the DICOM.instanceUIDs vtkMRMLScalarVolumeNode as follows.
The volume node will only have the dicom.instanceUIDs attribute if it was loaded through the DICOM module. Check that you loaded the data the same way in both your Slicer versions.
Yes, I use the same way to load dicom data, it is shown as follows.
with DICOMUtils.TemporaryDICOMDatabase(sql_folder_path) as db:
DICOMUtils.importDicom(dicomDataDir, db)
patientUIDs = db.patients()
for patientUID in patientUIDs:
loadedNodeIDs.extend(DICOMUtils.loadPatientByUID(patientUID))
loadedNodeIDs.extend(DICOMUtils.loadPatientByUID(patientUID))
I use the same code in the latest Slicer Preview Release to get DICOM.instancesUIDs,
redCompsiteNode=slicer.app.layoutManager().sliceWidget("Green").sliceLogic().GetSliceCompositeNode()
volumeID=redCompsiteNode.GetBackgroundVolumeID()
key='0010,0010'
volumeNode = slicer.util.getNode(volumeID)
value = slicer.dicomDatabase.instanceValue(volumeNode.GetAttribute('DICOM.instanceUIDs'), key)
but it occurs an error in redCompsiteNode.GetBackgroundVolumeID() . But this code does not report error in my sekf-build slicer with latest source code.
Moreover, When I use load two dicom data, there is only one dicom data is shown in windows, but my self-build version will display both two dicom data in all windows as shown in follows.
Additionally, due to this error, the I cannot run my code in these versions Slicer, so I want to build a Slicer use former source code ,but I cannot download former soruce code as follows.
To load the images correctly (i.e., reconstructing the curved geometry), make sure that the DICOMGeAbusPlugin plugin is enabled in DICOM module / DICOM Plugins section. DICOM.instanceUIDs is only set if loaded by DICOMScalarVolumePlugin. For all other DICOM data objects, such as the ABUS image, you can get the series instance UID from the subject hierarchy, as shown here.
I have check the node type and it is MRMLCore.vtkMRMLScalarVolumeNode, so I think maybe it is loaded by DICOMScalarVolumePlugin, is it correct?, If not, how can I use DICOMScalarVolumePlugin to load dicom data? Moreover, I also try to get the series instance UID from the subject hierarchy, but I cannot use series UID to get instance UID, the return of following code is empty.
redCompsiteNode = slicer.app.layoutManager().sliceWidget("Green").sliceLogic().GetSliceCompositeNode()
volumeID=redCompsiteNode.GetBackgroundVolumeID()
volumeNode = slicer.util.getNode(volumeID)
# Get series instance UID from subject hierarchy
shNode = slicer.vtkMRMLSubjectHierarchyNode.GetSubjectHierarchyNode(slicer.mrmlScene)
volumeItemId = shNode.GetItemByDataNode(volumeNode)
seriesInstanceUID = shNode.GetItemUID(volumeItemId, 'DICOM')
instUids = slicer.dicomDatabase.instancesForSeries(seriesInstanceUID)