Alternative to ImageJ 3D Viewer (Benjamin Schmid's)

fiji
imagej

#2

are you talking about clearvolume?


#3

@albertcardona

There is also SciView:

:slight_smile:


#4

@albertcardona SciView is the answer you’re looking for.


#5

Thanks. I enabled the SciView update site, restarted Fiji, then launched the “SciView” plugin and I got:

[ERROR] Module threw error
java.lang.NoClassDefFoundError: javafx/scene/Node
	at sc.iview.DefaultSciViewService.makeSciView(DefaultSciViewService.java:110)
	at sc.iview.DefaultSciViewService.getOrCreateActiveSciView(DefaultSciViewService.java:165)
	at sc.iview.commands.LaunchViewer.run(LaunchViewer.java:59)
	at org.scijava.command.CommandModule.run(CommandModule.java:199)
	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)
Caused by: java.lang.ClassNotFoundException: javafx.scene.Node
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 12 more

And:

(Fiji Is Just) ImageJ 2.0.0-rc-68/1.52h; Java 1.8.0_181 [64-bit]; Linux 4.4.0-137-generic; 72MB of 8192MB (<1%)
 
java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: javafx/scene/Node
	at net.imagej.legacy.LegacyService.runLegacyCompatibleCommand(LegacyService.java:303)
	at net.imagej.legacy.DefaultLegacyHooks.interceptRunPlugIn(DefaultLegacyHooks.java:163)
	at ij.IJ.runPlugIn(IJ.java)
	at ij.Executer.runCommand(Executer.java:137)
	at ij.Executer.run(Executer.java:66)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.util.concurrent.ExecutionException: java.lang.NoClassDefFoundError: javafx/scene/Node
	at java.util.concurrent.FutureTask.report(FutureTask.java:122)
	at java.util.concurrent.FutureTask.get(FutureTask.java:192)
	at net.imagej.legacy.LegacyService.runLegacyCompatibleCommand(LegacyService.java:299)
	... 5 more
Caused by: java.lang.NoClassDefFoundError: javafx/scene/Node
	at sc.iview.DefaultSciViewService.makeSciView(DefaultSciViewService.java:110)
	at sc.iview.DefaultSciViewService.getOrCreateActiveSciView(DefaultSciViewService.java:165)
	at sc.iview.commands.LaunchViewer.run(LaunchViewer.java:59)
	at org.scijava.command.CommandModule.run(CommandModule.java:199)
	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)
	... 1 more
Caused by: java.lang.ClassNotFoundException: javafx.scene.Node
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 12 more

#6

These errors come from not having JavaFX. Java has chosen JavaFX over Swing, and there were actually some benefits of using JavaFX in SciView.

At the moment, to resolve this you will need to have a JVM with JavaFX setup (@skalarproduktraum @hanslovsky and @axtimwalde have ideas about shipping JavaFX to eliminate this step in the future).

Oracle options: https://docs.oracle.com/javafx/2/installation/jfxpub-installation.htm
OpenJDK options: https://openjfx.io/

Let me know if something else comes up!


#7

Thanks. It would be useful to check in the plugin launcher for whether JavaFX exist in the file path, and if not, inform the user of what to do. Benjamin Schmid did this for Java 3D, which had the same problem. He even built in a java 3d library downloader and installer, but that may be a step too far here.

Will try and see what I can get.

My goal is to replace the 3D Viewer for this purpose: https://www.ini.uzh.ch/~acardona/fiji-tutorial/#3d-viewer

Hopefully SciView can handle 4D data sets already, and can generate volume renderings from a 4d hyperstack or a 4d ImgLib2 image?


Unable to convert stl to stacks
#8

So I did:

sudo apt-get install openjfx

… which installed libopenjfx-java (8u60-b27-4)

… and run into, upon launching SciView:

Loaded Deferred Shading (Deferred Shading, with HDR postprocessing and FXAA)
[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.

And the SciView window is stuck in the message “SciView is starting”.

Looks like the apt-get version is 8, whereas the webpage you pointed at is at version 11.

Trying that one now.


#9

About version 11 downloaded from the website: the zip file as folders legal and lib. Where should these go?


#10

And do I need the “JavaFX Linux jmods” ?


#11

All of the animations/simulation demos are currently implemented using the animation threading mechanism:

There was a recent forum question about how to achieve the timeline functionality from 3D viewer using SciView. I believe that one of the quickest ways to get this working is to implement a SciJava command that generates a slider for the length of the timeseries and the preview functionality to dynamically update the currently displayed volume using a HyperSlice view that is updated by the slider.


#12

Huh? I am not aware of any other solution than having JFX on your local machine, as long as you want to use Java8. OpenJFX11 is available through maven but requires Java10 for byte code compatibility.

That looks like a problem with lwjgl/scenery, and not JavaFX. @skalarproduktraum @kephale please help


#13

@albertcardona

What is in the jars/ directory?

I think I’ve seen this one when LWJGL jars get unpacked to the wrong directory.

FWIW, I use the Oracle JVM on my Ubuntu machine and have no issues.


#14

Hi @kephale, I am not sure I follow. I installed sciview from the update site via Fiji’s update system. Surely the jars are in the right place? Or you mean the JavaFX files?

On JavaFX, would version 8 then work, as installed by apt-get? What is the minimum JavaFX version for SciView to work? And are these apt-get installed files that are the ones perhaps in an unusual place? I am using Ubuntu 16.04.


#15

As @hanslovsky pointed out, it looks like the problem is coming from LWJGL (which packages the native libs used by scenery/SciView). It is not clear to me what is missing, but something is missing. I have seen similar errors pop up when the LWJGL native libraries get unpacked to the wrong place. It isn’t clear to me why that would be happening to you, as my Ubuntu box doesn’t have any issues with the SciView from the update site, but I haven’t had a chance to test it with OpenJDK on that machine.

Hopefully it is just a sanity check, but:
1 - it would be good to know what is inside jars/linux64 which is where the native libs should be unpacked for you, or just the whole listing of jars and its subdirectories if you don’t mind.
2 - it would also be good to know what jars are on your classpath


#16

Hey @albertcardona,

I think the source of the issue you are seeing is a quite outdated JDK - 8u60 if I read this correctly. Could you please try with 8u121 or higher and see if this changes things? Thanks!

Sorry, missed you are running 8u181 and confused it with the OpenJFX version. Could you please run Fiji with the flags the error message suggested, -Dorg.lwjgl.util.Debug=true and -Dorg.lwjgl.util.DebugLoader=true, and gist the complete log?

Thanks, and sorry for the confusion!


#17

Hi @skalarproduktraum,

I’ve installed JavaFX with apt-get install openjfx, which installs 8u60.
The java version is 1.8.0_181.

I’ve run fiji like:

$ ./ImageJ-linux64  -Dorg.lwjgl.util.Debug=true -Dorg.lwjgl.util.DebugLoader=true --

And the “Console” log says:

Started application as PID 16757
[LWJGL] Version: 3.2.0 build 12
[LWJGL] 	 OS: Linux v4.4.0-138-generic
[LWJGL] 	JRE: 1.8.0_181 amd64
[LWJGL] 	JVM: OpenJDK 64-Bit Server VM v25.181-b13 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL] 	Using SharedLibraryLoader...
[LWJGL] 	Extracting: file:/home/albert/Programming/fiji-new/Fiji.app/jars/linux64/lwjgl-3.2.0-natives-linux.jar!/liblwjgl.so
[LWJGL] 	Loaded from org.lwjgl.librarypath: /tmp/lwjglalbert/3.2.0-build-12/liblwjgl.so
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Loading library: jemalloc
[LWJGL] 	Using SharedLibraryLoader...
[LWJGL] 	Extracting: file:/home/albert/Programming/fiji-new/Fiji.app/jars/linux64/lwjgl-jemalloc-3.2.0-natives-linux.jar!/libjemalloc.so
[LWJGL] 	Loaded from org.lwjgl.librarypath: /tmp/lwjglalbert/3.2.0-build-12/libjemalloc.so
[LWJGL] MemoryUtil allocator: JEmallocAllocator
Loaded Deferred Shading (Deferred Shading, with HDR postprocessing and FXAA)
[LWJGL] Loading library: libvulkan.so.1
[LWJGL] 	libvulkan.so.1 not found in org.lwjgl.librarypath=/tmp/lwjglalbert/3.2.0-build-12
[LWJGL] 	libvulkan.so.1 not found in system paths
[LWJGL] 	libvulkan.so.1 not found in java.library.path=/home/albert/Programming/fiji-new/Fiji.app/lib/linux64:/home/albert/Programming/fiji-new/Fiji.app/mm/linux64:/tmp/spirvcrossj-natives-tmp6395579122179964866:/home/albert/Programming/fiji-new/Fiji.app/src/natives
[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.

And the terminal says:

$ ./ImageJ-linux64  -Dorg.lwjgl.util.Debug=true -Dorg.lwjgl.util.DebugLoader=true --

OpenJDK 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
OpenJDK 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
[GC (Allocation Failure)  272640K->19943K(8354560K), 0.0780626 secs]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/albert/Programming/fiji-new/Fiji.app/jars/logback-classic-1.2.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/home/albert/Programming/fiji-new/Fiji.app/jars/slf4j-simple-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [ch.qos.logback.classic.util.ContextSelectorStaticBinder]
[GC (Allocation Failure)  292583K->46620K(8354560K), 0.1306058 secs]
[GC (CMS Initial Mark)  56786K(8354560K), 0.0123498 secs]
[GC (Allocation Failure)  319260K->58026K(8354560K), 0.0996526 secs]
[GC (CMS Final Remark)  188995K(8354560K), 0.0532170 secs]
Started application as PID 16757
[GC (Allocation Failure)  318951K->79207K(8354560K), 0.0832293 secs]
[LWJGL] Version: 3.2.0 build 12
[LWJGL] 	 OS: Linux v4.4.0-138-generic
[LWJGL] 	JRE: 1.8.0_181 amd64
[LWJGL] 	JVM: OpenJDK 64-Bit Server VM v25.181-b13 by Oracle Corporation
[LWJGL] Loading library (system): lwjgl
[LWJGL] 	Using SharedLibraryLoader...
[LWJGL] 	Extracting: file:/home/albert/Programming/fiji-new/Fiji.app/jars/linux64/lwjgl-3.2.0-natives-linux.jar!/liblwjgl.so
[LWJGL] 	Loaded from org.lwjgl.librarypath: /tmp/lwjglalbert/3.2.0-build-12/liblwjgl.so
[LWJGL] MemoryUtil accessor: MemoryAccessorUnsafe
[LWJGL] Loading library: jemalloc
[LWJGL] 	Using SharedLibraryLoader...
[LWJGL] 	Extracting: file:/home/albert/Programming/fiji-new/Fiji.app/jars/linux64/lwjgl-jemalloc-3.2.0-natives-linux.jar!/libjemalloc.so
[LWJGL] 	Loaded from org.lwjgl.librarypath: /tmp/lwjglalbert/3.2.0-build-12/libjemalloc.so
[LWJGL] MemoryUtil allocator: JEmallocAllocator
Loaded Deferred Shading (Deferred Shading, with HDR postprocessing and FXAA)
[LWJGL] Loading library: libvulkan.so.1
[LWJGL] 	libvulkan.so.1 not found in org.lwjgl.librarypath=/tmp/lwjglalbert/3.2.0-build-12
[LWJGL] 	libvulkan.so.1 not found in system paths
[LWJGL] 	libvulkan.so.1 not found in java.library.path=/home/albert/Programming/fiji-new/Fiji.app/lib/linux64:/home/albert/Programming/fiji-new/Fiji.app/mm/linux64:/tmp/spirvcrossj-natives-tmp6395579122179964866:/home/albert/Programming/fiji-new/Fiji.app/src/natives
[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.
[GC (CMS Initial Mark)  262875K(8354560K), 0.0168678 secs]
[Full GC (System.gc())  311974K->43677K(8354560K), 0.1722228 secs]

Is there any other log?

Thanks.


#18

That is already very helpful! It’s not finding the Vulkan runtime! That should actually be caught, I’ll talk to the LWJGL people why this is not thrown as exception…

First, it’s important your graphics driver is up-to-date, could you please verify that?
Second, depending on your GPU, you have two options:

  1. if it’s an older one, try forcing it to run with OpenGL instead of Vulkan by defining -Dscenery.Renderer=OpenGLRenderer (this should actually be done automatically as fallback)
  2. install the Vulkan runtime (should be libvulkan in Ubuntu if I recall correctly)

Please let me know if this helped, thanks :+1:


#19

Hi @kephale,

The whole listing of jars/linux64:

$ /bin/ls
ffmpeg-2.6.1-0.11-linux-x86_64.jar
gluegen-rt-2.3.2-natives-linux-amd64.jar
jinput-platform-2.0.7-natives-linux.jar
joal-2.3.2-natives-linux-amd64.jar
jocl-2.3.2-natives-linux-amd64.jar
jogl-all-2.3.2-natives-linux-amd64.jar
jvrpn-1.1.0-natives-linux.jar
lwjgl-3.2.0-natives-linux.jar
lwjgl-glfw-3.2.0-natives-linux.jar
lwjgl-jemalloc-3.2.0-natives-linux.jar
lwjgl-opengl-3.2.0-natives-linux.jar
lwjgl-openvr-3.2.0-natives-linux.jar
spirvcrossj-0.4.2-natives-linux.jar

Jars in the classpath: that list might be very long. The ImageJ java class path (System.getProperty(“java.class.path”)) itself is very short, given the new way in which Fiji loads jar files:

/home/albert/Programming/fiji-new/Fiji.app/jars/imagej-launcher-4.0.5.jar

Albert


#20

Thanks!

So I installed vulkan:

$ sudo apt-get install libvulkan1

… and now there is only one error:

...
[ERROR] Call to Creating Vulkan instance failed: The requested version of Vulkan is not supported by the driver or is otherwise incompatible for implementation-specific reasons.
...

The driver is up to date, as far as I know, but likely this is the issue in my laptop. Will try the opengl backend, and also in a different computer.

Thanks very much.


#21

Okay great, progress :sunglasses:

Could you still let me know what GPU your laptop has so I can add it to the compatibility matrix at https://github.com/scenerygraphics/scenery#gpu-compatibility

Thanks!