I’m looking at a project to map the intensity (in HU) of a CT scan where it contacts a registered surface (STL) model, so I can quantify the cortical vs cancellous bone contact zones in different regions along a THA stem. I would be looking to produce something like the attached image, which I can then break into particular zones of interest (Gruen zones).
As a rough approach I’d be planning to try and measure the Hounsfield units of the nearest voxel to each vertex on my surface model (after remeshing to create a more uniform mesh size), and break these into specific regions of interest. Planned outputs would be to visually display a heatmap across the surface of the STL model, and to measure the min/max/avg etc. HU values across regions of vertices.
Mostly just hoping to get feedback whether:
A) This has already been done, and there’s already some sort of extension available
B) If not, whether it’s feasible and a reasonably achievable goal for someone with some (but not extensive) experience coding in Slicer
C) If there are any existing extensions or functions that would give me access to vertex points on a registered surface model, and allow me to then probe the nearest voxel for its intensity (HU) values
@LindenRB an option would be to convert the stl to a segmentation, use the margin effect to grow it by some amount, convert the grown segment to a model, and then use the probe volume with model module to get a scalar field of the CT values per vertex.
This has already been done, and there’s already some sort of extension available
Yes, the Pedicle Screw Simulator extension does exactly this:
I don’t think you need to use this extension for your project, because your models are different, you position them differently (in current Slicer versions it is very easy to position models using interactive transformation handles) and it takes just a few clicks to copy CT values to the model points.
If not, whether it’s feasible and a reasonably achievable goal for someone with some (but not extensive) experience coding in Slicer
You don’t need any coding to get started. If you want to streamline the processing (minimize number of clicks) or fully automate it then you can do that with Python scripting. If you have specific questions you can ask questions here, or for getting more substantial help or developing complete solutions you can contact Slicer Commercial Partners.
If there are any existing extensions or functions that would give me access to vertex points on a registered surface model, and allow me to then probe the nearest voxel for its intensity (HU) values
I’ve already created a few basic scripts and extensions for Slicer and really enjoy the process of scripting and GUI design within slicer, so I think I’ll have a go at building something myself for this. Appreciate your help and the resources you have provided!
Having a quick play around with the Probe volume with model is showing me exactly what I’d like to see (stem placed poorly deliberately to see cortical bone contrast)
Do you know if its easy to export something like a point map of the intensity values at each vertex to CSV or similar? If not I will go digging in the module code for the Probe model tool
Yes, it is a single command to get all point scalars as a numpy array, and another single command is to write to csv.
One important thing is that your model seem to have highly irregular triangles. For quantitative analysis, you probably want to have points distributed evenly on the whole implant surface. To achieve that, you can use the Surface Toolbox module’s uniform resampling tool.
Yes the stem models we have come out of Solidworks with highly non-uniform mesh geometry (apparently optimised…), was planning to remesh the models to something much more uniform before import, but if that can be done natively within slicer that makes my life even easier!