Operating system: windows 10
Slicer version: 4.11.20200930
How can I get the HU (CT) value at each fiducial placed on a model surface?
I could convert vertices of an STL model to a group of fiducials as shown in the attached image.
Then I would like to add another column next to the RAS coordinate table of the fiducial group.
I would like to know how I can get HU values at multiple fiducial points in the same group.
Ultimately, I’d like to get the HU values of the pixels corresponding to the vertices of the STL model placed in the CT volume data in a tabular format.
I was able to convert each vertex of the STL model to fiducial, as shown in the attached figure.
For these fiducial, is it possible to get the HU value and coordinate values of the pixels in which each of them is located in a table format?
You can sample a CT volume with at each point of a mesh using “Probe volume with model” module, and get the point coordinates and density values as numpy arrays by typing these into the Python console:
If you need the CT density values for FEM analysis then an STL file will not be sufficient, as it is a surface mesh, so it will not contain density information in the bone. You can generate a volumetric mesh from a segmentation using SegmentMesher extension.
Thank you for your kind reply. In addition, I would like to thank you for teaching me how to obtain the data for finite element analysis.
And I could get the list of coordinates of the model vertices. (I confirmed that by typing “print (coords)” in console window.)
However, I only could get the error in your code line3.
It says
modelNode = getNode(‘Dishreg3’)
coords = slicer.util.arrayFromModelPoints(modelNode)
densities = slicer.util.arrayFromModelPointData(modelNode, ‘ikeimage’)
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\MasatoshiOba\AppData\Local\NA-MIC\Slicer 4.11.20200930\bin\Python\slicer\util.py”, line 1293, in arrayFromModelPointData
narray = vtk.util.numpy_support.vtk_to_numpy(arrayVtk)
File “C:\Users\MasatoshiOba\AppData\Local\NA-MIC\Slicer 4.11.20200930\bin\Lib\site-packages\vtkmodules\util\numpy_support.py”, line 216, in vtk_to_numpy
typ = vtk_array.GetDataType()
AttributeError: ‘NoneType’ object has no attribute ‘GetDataType’
Is there something wrong with the way I installed Slicer? Or am I specifying the files in my NRRDimage the wrong way?
densities = slicer.util.arrayFromModelPointData(modelNode, ‘NRRDImage’)
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\MasatoshiOba\AppData\Local\NA-MIC\Slicer 4.11.20200930\bin\Python\slicer\util.py”, line 1293, in arrayFromModelPointData
narray = vtk.util.numpy_support.vtk_to_numpy(arrayVtk)
File “C:\Users\MasatoshiOba\AppData\Local\NA-MIC\Slicer 4.11.20200930\bin\Lib\site-packages\vtkmodules\util\numpy_support.py”, line 216, in vtk_to_numpy
typ = vtk_array.GetDataType()
AttributeError: ‘NoneType’ object has no attribute ‘GetDataType’
If I type
print(modelNode) and print(coords) after I typed line 2, they return what I want.
So something wrong with executing line3.