Unable to convert stl to stacks

Hi everyone,

I have an STL image (of arteries in the brain) and I want to get 2D slices or z stacks of this. I installed the 3D viewer and was reading somewhere that there is a way to convert this into stacks? However, when I open the stl in 3d viewer, it does not give me an option to view it as orthogonal slices/surface etc (all those options under ‘Edit’ are greyed out). I also can’t use the regular stack menu under Fiji/ImageJ with this STL as it is open under the 3D viewer and not as an image, so whenever I try to use any of the regular menu, it just says no image is open.

Can someone please help me with creating slices/stacks from this stl? I would really appreciate it. I tried uploading the STL but I guess the forum upload doesn’t allow STL files.

Hi @AditiD and welcome to the forum!

These two forum topics might contain some useful information:


Hi Jan,

Thanks for responding! I did look into those posts but didn’t seem to work for me, with the first one, there is no voxelization option in my 3D viewer and the view as orthogonal slices option in edit is grey out. With the solution posted in the second one, I downloaded SciView but when I run it, it gives an error :frowning:
I’ll reply onto one of those posts directly maybe, if that’s better.

Thank you!

I have one alternative for you. However, please report your SciView error, we would like to be sure that the SciView option is working.

  1. Install the funimagej update site
  2. Plugins>FunImageJ>Mesh>voxelize mesh
  3. Select your .stl file, enter the dimensions that you want for your stack.
  4. Enjoy a stack of your voxelized stl
1 Like

Hi Kyle,

Thanks for the suggestion… I had seen that on one of your other posts but it gives me an error :frowning:

Am I making a mistake in choosing the dimensions? Also, if this works somehow, this would give me one slice right? so if I want all the slices that would constitute the 3D volume/stl, how would I go about that?

Thanks again for your help!

Try updating from funimagej again. It seems like my fix didn’t get uploaded to the update site last time.

Thank you! FunImageJ seems to be working now… is there a way to view multiple slices/stacks? I mean for different depths?
Also, when I open SciView, this is the error I get:
[LWJGL] Failed to load a library. Possible solutions:
a) Install the library or the driver that provides the library.
b) Ensure that the library is accessible from the system library paths.
[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics.
[LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics.

Thanks again

I’m not sure I understand. You can make stacks at any resolution that you’d like (although you’ll have to figure out what this means in terms of actual units).

The general idea is to generate 1 stack for each STL/resolution. Then to proceed with standard techniques for processing stacks with ImageJ.

That SciView error was also encountered here: Alternative to ImageJ 3D Viewer (Benjamin Schmid's)
and a solution is posted later in the thread here: Alternative to ImageJ 3D Viewer (Benjamin Schmid's)

Yes, I chose the depth/resolution and it generated 1 stack for each resolution. But to proceed with further processing of these stacks, it doesn’t let me save them as images (I can just scroll to see all the stacks in the viewer in the plug-in but not actually export them as images/stacks). Is there a way to do that? Since without that I don’t think I can use these stacks for anything but viewing them? Sorry if there is already a way and I can’t seem to find it :frowning:

Thanks a lot, I really appreciate your help with this.

Hm, what happens when you try to save them? It works for me. Also, a quick potential workaround is to use Image>Duplicate to create a copy of the image and try to save the duplicate.

Hi Kyle,

It worked now! I got the slices saved :slight_smile: Thanks so much!!


Slice on!

Hi everyone,

I wanted to check if the FunImageJ plugin has been removed? It seems to be broken since s few months, when you import a mesh to voxelize, it just gives a bunch of errors and on my laptop, I don’t even see it in the plugins after updating…
Even the 3D viewer seems to be broken …

I am trying to slice a STL mesh using voxelization …

Does anyone know if this plugin is broken/removed? It would really help a lot.

Thank you!

I’ll check into it this weekend. It works in standalone mode, but I haven’t had a chance to check it inside Fiji in a while.

I’ve updated the FunImageJ update site, and voxelize mesh appears to be working again.

Please pardon the inconvenience and let me know if you have any issues.


Hi Kyle,

That’s great, thank you so much!! Appreciate it :slight_smile: will test it today

1 Like

Hi there,

Just wanted to update that this still doesn’t seem to be working :frowning: I uploaded a STL in the voxelize mesh and got these errors:

[ERROR] null
java.io.FileNotFoundException: Could not locate fun/imagej/img__init.class or fun/imagej/img.clj on classpath.
at clojure.lang.RT.load(RT.java:456)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5774)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:1096)
at plugins.Scripts.Plugins.FunImageJ.Mesh.voxelize_mesh$eval3$loading__5569__auto____4.invoke(NO_SOURCE_FILE:0)
at plugins.Scripts.Plugins.FunImageJ.Mesh.voxelize_mesh$eval3.invokeStatic(NO_SOURCE_FILE:0)
at plugins.Scripts.Plugins.FunImageJ.Mesh.voxelize_mesh$eval3.invoke(NO_SOURCE_FILE)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6916)
at clojure.lang.Compiler.eval(Compiler.java:6890)
at org.scijava.plugins.scripting.clojure.ClojureScriptEngine.eval(ClojureScriptEngine.java:88)
at org.scijava.plugins.scripting.clojure.ClojureScriptEngine.eval(ClojureScriptEngine.java:63)
at org.scijava.script.ScriptModule.run(ScriptModule.java:160)
at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)

I got the same error as @AditiD …has a solution to this been found?

1 Like