How to voxelize a .STL file

Tags: #<Tag:0x00007fd546869660>


I’m wanting to break down a . STL file to a stack of voxel images so that I can use ImageJ functions for 3d image analysis. Is there a plugin available?


[Edit]: the suggestion below does not work as stated for loaded STL files as indicated by @iarganda

Hi @kcstauffer,

it should be possible with the 3D Viewer. You can load .STL files into the 3D Viewer via the ►File menu. Then you can still apply transformations to the object and export it to a stack via ►Edit ►Transformation ►Export transformed image. The result will the 3D stack.


Hello @biovoxxel, I don’t think you can do that unless there is an underlying grayscale image. I just tried it out and got an error:



Hi @iarganda,

Autsch :confounded:
Sorry for the incorrect indication. You are right. I obviously had the input stack open ando forgot that the STL file actually only comprises the surface and does not have the intensity info available.
So just forget about my earlier suggestion.


Hi all,

We added voxelization to imagej-ops a bit ago:



I don’t know much about coding. Do you have a compressed .jar file so that I can just drop it into the plugins folder and have it work?


Almost! Or rather: there is almost a working ImageJ update site.

We added a page about voxelization to the ImageJ wiki awhile ago. However, those instructions are now outdated. The “ThreeDViewer” is now known as SciView. Much time and effort is being expended by @kephale and @skalarproduktraum and myself to get it to a usable state. One of its features is voxelization of meshes.

We are in the middle of a hackathon this week madly working on this stuff. So please stay tuned; hopefully we will have something for you to try soon.


Looking forward to it. Thanks!


Do we have any update from the December Hackathon? Is the a stable combination of plugins that can Voxelize an .stl today?



Not stable. But experimental, yes: you can enable the SciView update site to give it a try as described here (that documentation still says “ThreeDViewer” but the instructions are probably OK otherwise? @kephale?)

Note that the SciView update site is intentionally not on the built-in list of update sites yet, because it is not yet stable enough. But you can use the “Add update site” button to add it manually.

There will be another hackathon in late April specifically dedicated to SciView—the development continues!


Hey all,

Actually, to help tease apart graphics and mesh processing dependencies I added a STL voxelization script to FunImageJ.

Just enable the FunImageJ update site (it is in the standard update site list), then access the command via the menu at: Plugins>FunImageJ>Mesh>voxelize mesh. It asks for a STL file and voxel dimensions as input.

Note that voxelization is not a trivial problem, and if you get an unexpected result, then please contact me and I will look into it. There are a couple of folks who are joining me to dive a bit further into some fancier voxelization algorithms in the near future (coinciding with the SciView hackathon).