# Match vtkMRMLScalarVolumeNode to vtkMRMLLabelMapVolumeNode retrieved from vtkMRMLSegmentationNode

**URL:** <https://discourse.slicer.org/t/match-vtkmrmlscalarvolumenode-to-vtkmrmllabelmapvolumenode-retrieved-from-vtkmrmlsegmentationnode/22033>\
**Category:** Development\
**Created:** [February 17, 2022, 9:59pm UTC](https://discourse.slicer.org/t/match-vtkmrmlscalarvolumenode-to-vtkmrmllabelmapvolumenode-retrieved-from-vtkmrmlsegmentationnode/22033 "2022-02-17T21:59:12Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tetyanaloskutova](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tetyanaloskutova/32/14331_2.png) [@tetyanaloskutova](https://discourse.slicer.org/u/tetyanaloskutova)\
**Post date:** [February 17, 2022, 9:59pm UTC](https://discourse.slicer.org/t/match-vtkmrmlscalarvolumenode-to-vtkmrmllabelmapvolumenode-retrieved-from-vtkmrmlsegmentationnode/22033/1 "2022-02-17T21:59:12Z")

</div>

Hi, I have 23 scan images (vtkMRMLScalarVolumeNode ) and matching to some of them 13 vtkMRMLLabelMapVolumeNode retrieved from vtkMRMLSegmentationNode. They are not in order, i.e. 1st vtkMRMLScalarVolumeNode matches 7th vtkMRMLLabelMapVolumeNode. I can see which of them match in Slicer front end but I do not know which class field created from reading \*.dcm files contain this information.  
Can someone point me in the right direction? Thanks!

---

<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:** [February 17, 2022, 11:04pm UTC](https://discourse.slicer.org/t/match-vtkmrmlscalarvolumenode-to-vtkmrmllabelmapvolumenode-retrieved-from-vtkmrmlsegmentationnode/22033/2 "2022-02-17T23:04:43Z")

</div>

It all depends how you organized your data in your scene. For example, you can associate nodes using MRML node references, subject hierarchy folders, or DICOM UIDs. Can you post a screenshot of the tree in the Data module?

---

<div class="post-metadata">

**Author:** ![tetyanaloskutova](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tetyanaloskutova/32/14331_2.png) [@tetyanaloskutova](https://discourse.slicer.org/u/tetyanaloskutova)\
**Post date:** [February 17, 2022, 11:23pm UTC](https://discourse.slicer.org/t/match-vtkmrmlscalarvolumenode-to-vtkmrmllabelmapvolumenode-retrieved-from-vtkmrmlsegmentationnode/22033/3 "2022-02-17T23:23:25Z")

</div>

Hi Andras, thanks for your answer! I attach the screenshot from the Scene if that is what you meant… However, I do not create or load the scene when I read the files, so preferably I would like to match the data in two folders (“Ax T2 FSE” and “Ax T2 FSE Giloma Segmentation Corrected” on the screenshot) without referencing the scene. Would DICOM UID be the right approach? I can literally see the references in the dcm files but parsing them manually sounds like reinventing the wheel…  
Thanks a lot!

 ![Screenshot 2022-02-17 181333](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/8/4/84cc21131aeceec04540efc2be39c9ec46392648.png)

---

<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:** [February 18, 2022, 1:16am UTC](https://discourse.slicer.org/t/match-vtkmrmlscalarvolumenode-to-vtkmrmllabelmapvolumenode-retrieved-from-vtkmrmlsegmentationnode/22033/4 "2022-02-18T01:16:31Z")

</div>

DICOM Segmentation Object refers to a DICOM image file at many levels (see `ReferencedSOPInstanceUID` and `SeriesInstanceUID` tags by right-clicking on the segmentation object and choosing “View DICOM metadata”).

I had a quick look and it seemed that Slicer’s DICOM Segmentation Object importer uses the [SeriesInstanceUID](https://dicom.innolitics.com/ciods/segmentation/common-instance-reference/00081115) in the first ReferencedSeriesSequence.

---

<div class="post-metadata">

**Author:** ![tetyanaloskutova](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/tetyanaloskutova/32/14331_2.png) [@tetyanaloskutova](https://discourse.slicer.org/u/tetyanaloskutova)\
**Post date:** [February 18, 2022, 11:19pm UTC](https://discourse.slicer.org/t/match-vtkmrmlscalarvolumenode-to-vtkmrmllabelmapvolumenode-retrieved-from-vtkmrmlsegmentationnode/22033/5 "2022-02-18T23:19:14Z")

</div>

Thanks Andras, the links you gave helped! Finally, it turned out that reading the segmentation file using pydicom gives the correct sequence.
