# How to update position, rotation of segmented Dicom volume?

**URL:** <https://discourse.slicer.org/t/how-to-update-position-rotation-of-segmented-dicom-volume/17264>\
**Category:** Development\
**Tags:** segmentation\
**Created:** [April 23, 2021, 1:27am UTC](https://discourse.slicer.org/t/how-to-update-position-rotation-of-segmented-dicom-volume/17264 "2021-04-23T01:27:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![msimonc](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/msimonc/32/10762_2.png) [@msimonc](https://discourse.slicer.org/u/msimonc)\
**Post date:** [April 23, 2021, 1:27am UTC](https://discourse.slicer.org/t/how-to-update-position-rotation-of-segmented-dicom-volume/17264/1 "2021-04-23T01:27:41Z")

</div>

Operating system: Windows 10  
Slicer version: 4.13.0

I have:  
Imported a Dicom file  
Segmented by painting slices  
(a rotatable shape renders on the stage)

Created a Py Extension using Developer Tools | Wizard  
added a callback to a Qt control:

volumeNode = slicer.util.getNode(‘volName’)  
print(volumeNode) # vtkMRMLScalarVolumeNode properties as expected

I have been unable to:  
reposition or rotate the volume on the stage in code  
set the color of the volume  
cause any change to the staged volume, ex.  
volumeNode.GetDisplayNode().SetColor(1,0,1)  
slicer.app.processEvents()

all help appreciated!

---

<div class="post-metadata">

**Author:** ![roozbehshams](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/roozbehshams/32/1544_2.png) [@roozbehshams](https://discourse.slicer.org/u/roozbehshams)\
**Post date:** [April 23, 2021, 2:04am UTC](https://discourse.slicer.org/t/how-to-update-position-rotation-of-segmented-dicom-volume/17264/2 "2021-04-23T02:04:05Z")

</div>

Depending on what your goal is this may not be the optimum path but you can start by converting the scalar volume node to a label map volume and create a segmentation node from it. You can then change the color of certain segments.  
For rotating and translation you can create a transform node and set that node as the parent transform for the segmentation node.  
There are examples in the [script repository](https://www.slicer.org/wiki/Documentation/Nightly/ScriptRepository#Create_a_segmentation_from_a_labelmap_volume_and_display_in_3D) to do the above and a lot more.

---

<div class="post-metadata">

**Author:** ![msimonc](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/msimonc/32/10762_2.png) [@msimonc](https://discourse.slicer.org/u/msimonc)\
**Post date:** [April 23, 2021, 5:17am UTC](https://discourse.slicer.org/t/how-to-update-position-rotation-of-segmented-dicom-volume/17264/3 "2021-04-23T05:17:02Z")

</div>

Thanks @roozbehshams  
If the volume is already rotatable using the mouse on the stage, why does a transform node need to be created?  
Also if I run util.getNodes(), I already have a vtkMRMLSegmentationNode, vtkMRMLSegmentationStorageNode and vtkMRMLSegmentationDisplayNode. Do I still need Labelmap-\> segment and if so why, thank you.

---

<div class="post-metadata">

**Author:** ![roozbehshams](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/roozbehshams/32/1544_2.png) [@roozbehshams](https://discourse.slicer.org/u/roozbehshams)\
**Post date:** [April 23, 2021, 2:40pm UTC](https://discourse.slicer.org/t/how-to-update-position-rotation-of-segmented-dicom-volume/17264/4 "2021-04-23T14:40:04Z")

</div>

Technically you’re moving the camera in the scene, not the volume. Like this you can create transforms for each node in the scene when you have more than one node in it.  
If you already have a SegmentationNode with your segments in it, then you’re set, no need for conversion.
