Display heatmap of Hounsfield values on registered surface object for cortical bone contact

Hi all,

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).


Source DOI: 10.1007%2Fs00402-021-04273-5

Before I go re-inventing the wheel, I thought I would see if anyone is aware of any open source extension or feature which already achieves this goal. From some preliminary searching, I believe the Pedicle Screw Simulator extension that Andrew Lasso has mentioned in this forum several times may already be doing the a lot of what I want to do:
https://discourse.slicer.org/t/how-to-measure-the-boundary-ct-value-of-a-circular-section/27104
https://github.com/lassoan/PedicleScrewSimulator/blob/master/PedicleScrewPlanner/PedicleScrewPlannerWizard/PlanningGradeStep.py

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

Cheers,
Linden

Dear Linden,

unfortunately I don’t know it for 3D Slicer, but it should work with my free tool:

Best regards,
Heiko

@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.

Many thanks for your reply Heiko, I will look into your ImageXd tool

Man thanks Steve, I will give this approach a try and see how it goes, appreciate the help!

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

Probe volume with model module does exactly this.

Thank you so much for the reply Andras!

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

Again much appreciate the help!

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.

Many thanks once again Andras!

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!