# How to get the masterVolumeNode from the dicom series

**URL:** <https://discourse.slicer.org/t/how-to-get-the-mastervolumenode-from-the-dicom-series/26110>\
**Category:** Development\
**Created:** [November 7, 2022, 1:39pm UTC](https://discourse.slicer.org/t/how-to-get-the-mastervolumenode-from-the-dicom-series/26110 "2022-11-07T13:39:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![user\_ghost](https://avatars.discourse-cdn.com/v4/letter/u/ee7513/32.png) [@user\_ghost](https://discourse.slicer.org/u/user_ghost)\
**Post date:** [November 7, 2022, 1:39pm UTC](https://discourse.slicer.org/t/how-to-get-the-mastervolumenode-from-the-dicom-series/26110/1 "2022-11-07T13:39:21Z")

</div>

hello every teachers:  
I used python code to load the ct dicom files, then i want to get the masterVolumeNode from the dicom file ,  
the load dicom files as followes:

```python
def loadCtData():
    dicomDataDir = "D:/xgx/newdicom"  
    ###"D:\301\15\443250" "D:/301/15/443250"
    loadedNodeIDs = []  

    from DICOMLib import DICOMUtils
    with DICOMUtils.TemporaryDICOMDatabase() as db:
        DICOMUtils.importDicom(dicomDataDir, db)
        patientUIDs = db.patients()
        for patientUID in patientUIDs:
            loadedNodeIDs.extend(DICOMUtils.loadPatientByUID(patientUID))
        print(type(db))

```

---

<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:** [November 7, 2022, 7:18pm UTC](https://discourse.slicer.org/t/how-to-get-the-mastervolumenode-from-the-dicom-series/26110/2 "2022-11-07T19:18:46Z")

</div>

You can get the referenced volume node from the segmentation via the `referenceImageGeometryRef` node reference. For example:

```python
segmentationNode = getNode('Segmentation')
volumeNode = segmentationNode.GetNodeReference('referenceImageGeometryRef')

```

---

<div class="post-metadata">

**Author:** ![user\_ghost](https://avatars.discourse-cdn.com/v4/letter/u/ee7513/32.png) [@user\_ghost](https://discourse.slicer.org/u/user_ghost)\
**Post date:** [November 17, 2022, 5:23am UTC](https://discourse.slicer.org/t/how-to-get-the-mastervolumenode-from-the-dicom-series/26110/3 "2022-11-17T05:23:21Z")

</div>

ok, i wlii try, thanks
