# Obtain the HU values for given 3D points with x,y,z coordinates

**URL:** <https://discourse.slicer.org/t/obtain-the-hu-values-for-given-3d-points-with-x-y-z-coordinates/19478>\
**Category:** Support\
**Created:** [September 2, 2021, 6:13am UTC](https://discourse.slicer.org/t/obtain-the-hu-values-for-given-3d-points-with-x-y-z-coordinates/19478 "2021-09-02T06:13:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![M.Odaba](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@M.Odaba](https://discourse.slicer.org/u/M.Odaba)\
**Post date:** [September 2, 2021, 6:13am UTC](https://discourse.slicer.org/t/obtain-the-hu-values-for-given-3d-points-with-x-y-z-coordinates/19478/1 "2021-09-02T06:13:38Z")

</div>

Hi,  
I’ve been trying to find a way to obtain the HU values for specific x,y,z coordinates. I explain what I’m trying to do.  
Let say I have a CT scan of a bone and I have generated rays in 3D space. Once these rays intersect with bone, each can generate different HU profile. So, I do have set of 3D points (x,y,z coordinates) on each ray within the bone and I need to obtain the HU value for each point in order to get the HU profile on the ray. I’m thinking of a code which can get the 3D points (x,y,z coordinates) as inputs and find the HU values. I understand that these point may not be exactly matched with voxel nodes. So, the HU value should be obtained from interpolations/extrapolations I think. Any suggestions, examples, or pre-existing codes?  
Thanks a lot.

---

<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:** [September 2, 2021, 6:19am UTC](https://discourse.slicer.org/t/obtain-the-hu-values-for-given-3d-points-with-x-y-z-coordinates/19478/2 "2021-09-02T06:19:04Z")

</div>

You can get an HU profile along a straight line in 3D using “Line profile” module (in Sandbox extension).

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/7/1/717cf030f636744f7affc568af60b54b4b3d3169.jpeg)

---

<div class="post-metadata">

**Author:** ![M.Odaba](https://avatars.discourse-cdn.com/v4/letter/m/e9c0ed/32.png) [@M.Odaba](https://discourse.slicer.org/u/M.Odaba)\
**Post date:** [September 8, 2021, 10:19am UTC](https://discourse.slicer.org/t/obtain-the-hu-values-for-given-3d-points-with-x-y-z-coordinates/19478/3 "2021-09-08T10:19:00Z")

</div>

I went through the Python code of the Line Profile, it only accepts the location of markup points manually created on the views to create a line. I need to create the line out of know coordinates in 3D space. Do you know how I can use my own points (using x,y,z coordinates) instead of manually selecting the markup points? Thanks.
