# different built version slicer cannot get dicom.instanceUIDs attribute

**URL:** <https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599>\
**Category:** Development\
**Created:** [March 19, 2022, 12:23pm UTC](https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599 "2022-03-19T12:23:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![luxiaoyanglxy9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/luxiaoyanglxy9999/32/14719_2.png) [@luxiaoyanglxy9999](https://discourse.slicer.org/u/luxiaoyanglxy9999)\
**Post date:** [March 19, 2022, 12:23pm UTC](https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599/1 "2022-03-19T12:23:03Z")

</div>

Hi,

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.

 ![badone](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/e/6e7fd4c86261ac5166cb1bb12c9c14b855e1df86.png)

But, in my previous self-build slicer (4.11.0), there is a DICOM.instanceUIDs attribute in vtkMRMLScalarVolumeNode as follows.

 ![KO~E%2F``$MW7H73UH9F_3R](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/d/8dacc0c1a70276524fc540c57c96abbd00673dda.png)

why this happens? what should I do to solve this problem?

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [March 19, 2022, 3:59pm UTC](https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599/2 "2022-03-19T15:59:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![luxiaoyanglxy9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/luxiaoyanglxy9999/32/14719_2.png) [@luxiaoyanglxy9999](https://discourse.slicer.org/u/luxiaoyanglxy9999)\
**Post date:** [March 20, 2022, 4:03am UTC](https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599/3 "2022-03-20T04:03:18Z")

</div>

Yes, I use the same way to load dicom data, it is shown as follows.

```auto
                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))

```

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 20, 2022, 12:31pm UTC](https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599/4 "2022-03-20T12:31:17Z")

</div>

Are the dicom.instanceUIDs there if you use the latest Slicer Preview Release?

---

<div class="post-metadata">

**Author:** ![luxiaoyanglxy9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/luxiaoyanglxy9999/32/14719_2.png) [@luxiaoyanglxy9999](https://discourse.slicer.org/u/luxiaoyanglxy9999)\
**Post date:** [March 21, 2022, 11:09am UTC](https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599/5 "2022-03-21T11:09:21Z")

</div>

I use the same code in the latest Slicer Preview Release to get DICOM.instancesUIDs,

```auto
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.

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 21, 2022, 12:21pm UTC](https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599/6 "2022-03-21T12:21:21Z")

</div>

> [@luxiaoyanglxy9999](#):
>
> but it occurs an error in redCompsiteNode.GetBackgroundVolumeID()

What is the error message?

---

<div class="post-metadata">

**Author:** ![luxiaoyanglxy9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/luxiaoyanglxy9999/32/14719_2.png) [@luxiaoyanglxy9999](https://discourse.slicer.org/u/luxiaoyanglxy9999)\
**Post date:** [March 22, 2022, 5:30am UTC](https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599/7 "2022-03-22T05:30:39Z")

</div>

There is an error as the value of volumeID is None.

```auto
redCompsiteNode = slicer.app.layoutManager().sliceWidget("Green").sliceLogic().GetSliceCompositeNode()
volumeID=redCompsiteNode.GetBackgroundVolumeID()

```

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.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/f/8f41919106e4b41721b074be8498d13c1786582f.jpeg)

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/3/d/3d937d8777e20aa576a164085411af654fc256ac.jpeg)

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.

 ![d80b61cb17c50cd270f4e8fb8514ef6](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/e/de5c503058cd5de9cb72555d41e0e3b586bf1b08.jpeg)  
 ![223d4df55e62fdf493fc81c35bb9874](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/2/c295120eca7781d0cb0c11c322b6b5d5a85b2d34.jpeg)  
Could you please tell me how to get foremer Slcier source code?

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [March 22, 2022, 6:29am UTC](https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599/8 "2022-03-22T06:29:38Z")

</div>

All Slicer versions are available at [https://github.com/Slicer/Slicer/commits/master](https://github.com/Slicer/Slicer/commits/master).

It looks like you are loading a GE Invenia ABUS image. A [reader plugin for such images was added to Slicer Preview Release a couple of months ago](https://discourse.slicer.org/t/load-ge-invenia-abus-images-from-dicom/15067).

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](https://slicer.readthedocs.io/en/latest/developer_guide/script_repository.html#access-tag-of-an-item-in-the-subject-hierarchy-tree).

---

<div class="post-metadata">

**Author:** ![luxiaoyanglxy9999](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/luxiaoyanglxy9999/32/14719_2.png) [@luxiaoyanglxy9999](https://discourse.slicer.org/u/luxiaoyanglxy9999)\
**Post date:** [March 23, 2022, 3:59am UTC](https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599/9 "2022-03-23T03:59:59Z")

</div>

> [@lassoan](#):
>
> DICOMScalarVolumePlugin

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.

```auto
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)

```

---

<div class="post-metadata">

**Author:** ![lassoan](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/lassoan/32/13_2.png) [@lassoan](https://discourse.slicer.org/u/lassoan)\
**Post date:** [April 9, 2022, 6:23pm UTC](https://discourse.slicer.org/t/different-built-version-slicer-cannot-get-dicom-instanceuids-attribute/22599/10 "2022-04-09T18:23:36Z")

</div>

There are a number of DICOM reader plugins that create a scalar volume node. DICOMScalarVolumePlugin is just the generic 3D volume reader.

Does `seriesInstanceUID` look valid? Does it match the series instance UID in the DICOM metadata in the DICOM browser?
