Calculate local thickness from STL

Hello everyone. I have a STL of trabecular bone made from microCT images. Can anyone guide me (step by step) to calculate local thickness using BoneJ? I tried using Sciview to import STL, Process > Mesh to Image. But could not proceed much.
Also, is it possible to get coordinate-wise local thickness data from BoneJ?
(I am very much new to this platform and have very little knowledge of coding or programming)
Thanks in advance

@kephale may be able to advise on this point.

Could you share some screenshots and example data?

It would also help to record a macro, Plugins>Macros>Record and paste the output here.

Yes, just tick the Show thickness maps option. The resulting image is the thickness value at each point in space of the input image. The BoneJ logo is such an image.

Thank you for the response.
Please check the screenshot


This is the macro

run("SciView");
open("sc.iview.SciView@121cc913");
run("Mesh To Image", "sciview=sc.iview.SciView@121cc913 width=1000 height=1000 depth=40 mesh=Mesh(Mesh)");
selectWindow("img");
run("Duplicate...", "use");
run("Thickness");

This shows the error “Need a 3D (x, y, z) image)”

Can it be exported tabular form, like thickness and its corresponding location?
Sample.zip (260.7 KB)

OK. I could do this


Image>Stacks>Stacks to images
Image>Stacks>Images to stacks
But it seems hollow, could not fill inside the STL.

The image on the right in your first screenshot shows the voxelization result of “Mesh->Image” for sciview

The voxelization algorithm solves for the surface of the mesh but does not fill the interior, you need to do this manually with something like the 3D Flood Fill tool.

2 Likes

Thank you @kephale
I tried Flood Fill (3D). But it fills the entire region. Is it possible to import voxelized mesh from other software (like cdb or inp format) into Fiji?

Sure you can import images from other formats.

The issue with the flood fill covering the whole image might be the resolution of your mesh to image call. The resulting image isn’t guaranteed to be watertight for all resolutions. Large outputs are more likely to be watertight.

1 Like

Yes, but your table will be huge. It is generally very inefficient to store numerical values using text characters!

1 Like

You would be much better off to go back to the X-ray microtomography images and use Image>Adjust>Threshold into foreground (bone) and background (marrow space). Skip the STL step altogether, it is not well-suited to most analysis in BoneJ.

2 Likes

Thanks @mdoube
This seems much easier.

I would like to try that, please tell me how can I do that?

I recommend that you don’t try it, but if you must…

The Image>Transform>Image to Results command extracts the pixel values of the active image or selection to the Results table.

From: http://imagej.1557.x6.nabble.com/Extracting-pixel-values-to-results-table-tp3683931p5019855.html

It would be interesting to know the file size of your table of text data versus the input image.

1 Like

Thank you very much @mdoube
Now I understand how it works. I guess it measures pixel-wise thickness of each image. I just omitted the “NaN” in the excel sheet it shows the exact image.

Thank you for your time.