How can I identify and export individual particles to an STL file?

fiji
segmentation

#1

Hello all, I’m new to Fiji and actually my background is civil engineering. I used Fiji to segment a 3D scanned image of touching sand particles. The sample was segmented by level-set method in Plugins-Segmentation, and I got an image stack like such


The white is background and the black is identified as individual particles. I want to export one of them as surface mesh in STL format, so that the 3D shape can be loaded by a third party software for engineering modelling. I’ve tried Analyze Particles and some other functions but seemed they can’t meet my purpose.

Can anyone help me with that? Please give me some guidance on exporting a single 3D particle. Thanks in advance!


#2

Hi @Don_HUO,

you can read in your thresholded binary stack in the 3D Viewer.

Those STL files can easily be opend/imported in software like Blender.

If you need only one of your objects you can try to read in those first in the 3D Manager from the 3D suite update site (→Plugins→3D→3D Manager). From here you can add individual objects to the 3D Viewer (to my knowledge) and then export only those.

Hope that helps.


#3

Noting that I would like this to be easier to do in SciView, and it eventually will be. Here is what I do to accomplish this goal:

Given some stack with thresholded/binary blobs, e.g.

In Analyze>3D OC Options, disable show numbers:

Then generate an image where each segment is labeled with a unique number. This is accomplished with Analyze>3D Objects Counter and selecting “Objects” as follows (note that you may not want to use the size filter, if so, then make min 0 and max very large):

This will give you a new stack with each connected region (sometimes called connected components) filled with a unique number (change the LUT to a colorful one like 3-3-2, to better see your labeled segments):

Sometimes if I need to do this as a quick one-off task, then I just take this image and use a threshold to grab a single number:

Now you have a stack that only contains a region for your object of interest, and you can go ahead and use 3D Viewer or SciView or imagej-ops to generate a mesh that can be saved as a STL.

If you need to make STLs for each object, then you may want to write a script that creates stack for each segmentation ID in your image, create the STL, and save it to disk.

~Kyle


#4

Thank you Kyle for your kind support. I can roughly keep with the procedures you uploaded, until the very last step where I used 3D Viewer to open the thresholded particle. However my 3D Viewer showed something strange, it showed several slices without surface interpolation, like the figure below. And when I clicked ‘Export Surfaces’ it showed me ‘no meshes to export’. Did I miss some procedures or did I operate something wrong?


#5

Ohmmm I can roughly understand your way, because I explored a bit 3D Viewer etc. However I don’t quite get the detail procedures for outputting one single particle. Anyway your answer is inspiring to me, and thank you for your support!


#6

Thank you Kyle for your kind support (seems my previous reply did not work properly). I can roughly keep with the procedures you uploaded, until the very last step where I used 3D Viewer to open the thresholded particle. However my 3D Viewer showed something strange, it showed several slices without surface interpolation, like the figure below. And when I clicked ‘Export Surfaces’ it showed me ‘no meshes to export’. Did I miss some procedures or did I operate something wrong?


#7

First, check if you added your thresholded particle as a surface, instead of a volume.

I had to quickly repeat the above steps to make a mask of a single particle:

Then, open SciView (install through the SciView update site if necessary)

In SciView make an isosurface of your image:

Select the image and threshold for the isosurface:

I also had to adjust the render scale. SciView should add a feature to automatically/reasonably adjust the render scale for default behavior. To do this, in SciView: Edit > Node Properties, change the value of Global Renderscale (I used 0.001). Then, in SciView: View > Center on Node

If you want to save as STL, File > Export as STL

~Kyle


#9

I see now! That’s very helpful. Thank you very much!


#10

Sorry to ask you one more stupid question…

How to add SciView into Fiji? I always used 3DViewer in Fiji, but it’s not so powerful compared to SciView.

Thank you!


#11

Hey, the best way would be to use the updater: FiJi/Help/update/manage update sites and then look for SciView :slight_smile:

best

Tobias