# Extract values at voxels within a segment

**URL:** https://discourse.slicer.org/t/extract-values-at-voxels-within-a-segment/28077
**Category:** Support
**Created:** [February 27, 2023, 9:24pm UTC](https://discourse.slicer.org/t/extract-values-at-voxels-within-a-segment/28077 "2023-02-27T21:24:04Z")
**Posts on this page:** 1
**Showing post:** 5

<div class="post-metadata">

### Author: ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)
#### Post date: [March 15, 2023, 4:35am UTC](https://discourse.slicer.org/t/extract-values-at-voxels-within-a-segment/28077/5 "2023-03-15T04:35:34Z")

</div>

If you mean the physical (RAS) coordinates, I think you can rework this example:

> [@Convert between RAS and numpy array indices](https://discourse.slicer.org/t/convert-between-ras-and-numpy-array-indices/19408/2):
>
> First, download MRHead data from Sample Data module import numpy as np volumeArray = slicer.util.array("MRHead") # Get the image data in numpy array format volumeArray[60, 127, 150] = 0 # Make one voxel black, numpy array is in KJI, not IJK. volumeNode = slicer.mrmlScene.GetFirstNodeByName("MRHead") volumeNode.Modified() # I think this is needed to let Slicer know the image was modified. ijkToRasMatrix = vtk.vtkMatrix4x4() volumeNode.GetIJKToRASMatrix(ijkToRasMatrix) ijkPoint = np.array([150…

---

_[View the full topic](https://discourse.slicer.org/t/extract-values-at-voxels-within-a-segment/28077)._
