Login  Register

Re: java3D and java 1.8

Posted by Aryeh Weiss on Nov 24, 2015; 9:07am
URL: http://imagej.273.s1.nabble.com/help-with-3D-segmentation-tp5014798p5015013.html

Hi Curtis,

Thank you for your response.

On 24/11/2015 5:33 AM, Curtis Rueden wrote:

> Hi Aryeh,
>
> Apologies for the long delay in reply. I have been working to get Java
> 3D working with Java 8. I finally got it to the point where I could
> create an update site and upload something for you to try.
>
> The new update site is called "3D" and it requires at least Java 7. It
> updates Fiji's Java-3D-based components—the 3D Viewer in particular—to
> use the new Java 3D 1.6 [1], so that the 3D Viewer can be used with
> Java 8.
>
> Please try enabling the new "3D" update site with Java 8 and let me
> know how things work for you!
>

I did this, and it started out ok. However, when I resized the window of
the 3D viewer, the following appeared in the Console:

com.jogamp.opengl.GLException: detachAllImpl failed: FBO implementation
fault, FBO[name r/w 2/2, init true, bound true, size 604x594, samples
0/8, modified true/true, depth RenderAttachment[type DEPTH, format
0x81a5, samples 0, 604x594, name 0xffffffff, obj 0x17430ea1], stencil
null, colorbuffer attachments: 1/8, with 1 textures:
[TextureAttachment[type COLOR_TEXTURE, target GL_TEXTURE_2D, level 0,
format 0x8051, 604x594, border 0, dataFormat 0x1907, dataType 0x1401;
min/mag 0x2600/0x2600, wrap S/T 0x812f/0x812f; name 0xffffffff, obj
0x1e012244], null, null, null, null, null, null, null], msaa[null,
hasSink false, dirty true], state FBO implementation fault, obj 0xc71d0f]
     at com.jogamp.opengl.FBObject.detachAllImpl(FBObject.java:2198)
     at com.jogamp.opengl.FBObject.reset(FBObject.java:1139)
     at
org.scijava.java3d.JoglPipeline.resizeOffscreenLayer(JoglPipeline.java:6290)
     at org.scijava.java3d.Canvas3D.setViewport(Canvas3D.java:4864)
     at org.scijava.java3d.Renderer.doWork(Renderer.java:993)
     at org.scijava.java3d.J3dThread.run(J3dThread.java:271)
Exception occurred in RenderingErrorListener:
java.lang.RuntimeException
     at
ij3d.ImageWindow3D$ErrorListener.errorOccurred(ImageWindow3D.java:295)
     at
org.scijava.java3d.VirtualUniverse.notifyRenderingErrorListeners(VirtualUniverse.java:1198)
     at
org.scijava.java3d.NotificationThread.processNotifications(NotificationThread.java:86)
     at
org.scijava.java3d.NotificationThread.run(NotificationThread.java:104)

Following this, none of the ImageJ functions work. The menus appear and
I can click on the menu entries, but nothing happens. In order to quit I
have to kill the ImageJ process. If I click on the imagej interface
window, the menus do not appear, but if I click on an imagej window,
then the menus associated with  those windows appear, and can be
selected (but no actions will be taken).

I hope this helps you locate the problem.

Best regards
--aryeh

> Regards,
> Curtis
>
> [1] Actually, I had to fork Java 3D temporarily to get everything to
> work as needed. It's a long story and I will probably make a news post
> about it soon.
>
> On Thu, Nov 5, 2015 at 5:24 AM, Aryeh Weiss <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Hi Curtis
>
>     Thank you for your reply about java3D and java 1.8
>     I am following up on this as a separate thread.
>
>     On 02/11/2015 7:54 PM, Curtis Rueden wrote:
>
>         Hi Aryeh,
>
>         Note that the Fiji-devel mailing list is closed now in favor
>         of the ImageJ forum. Somehow, you still had permission to post
>         (along with some others), but I have now (I hope!) fully
>         closed the fiji-devel list from posts from anyone whatsoever.
>
>         It is always best to discuss issues in public, rather than via
>         private mails. Albert is not the person responsible for
>         maintaining the 3D Viewer.
>
>         Note that the 3D Viewer does not currently work with Java 7
>         and 8 on OS X. We are working on addressing that (see
>         https://github.com/imagej/imagej/issues/120), but it is not
>         yet ready for prime time.
>
>         Right now you have two options:
>
>         1) Use Java 6
>         (http://imagej.net/FAQ#How_do_I_set_up_Java_6_on_OS_X.3F); or
>
>     If I do this,  then Plugins>Utilites>Debugging>Test Java3D
>     works correctly (spinning pretty box)
>
>     However, the following code:
>     # Show the peaks as spheres in 3D, along with orthoslices:
>     univ = Image3DUniverse(1024, 1024)
>     print type(univ)
>     univ.addIcospheres(ps, Color3f(1, 0, 0), 2, cell_diameter/2,
>     "Cells").setLocked(True)
>     univ.addOrthoslice(imp).setLocked(True)
>     univ.show()
>
>     will throw the following error:
>     Traceback (most recent call last):
>       File "/Users/amw1/Desktop/projects/tzachAuman/dog1.py", line
>     105, in <module>
>         at ij3d.shapes.BoundingBox.<init>(BoundingBox.java:66)
>         at ij3d.shapes.BoundingBox.<init>(BoundingBox.java:34)
>         at ij3d.shapes.BoundingBox.<init>(BoundingBox.java:30)
>         at ij3d.ContentInstant.display(ContentInstant.java:216)
>         at ij3d.ContentCreator.createContent(ContentCreator.java:111)
>         at ij3d.ContentCreator.createContent(ContentCreator.java:98)
>         at ij3d.Image3DUniverse.createContent(Image3DUniverse.java:1195)
>         at ij3d.Image3DUniverse.addCustomMesh(Image3DUniverse.java:1163)
>         at ij3d.Image3DUniverse.addIcospheres(Image3DUniverse.java:1285)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>
>     java.lang.NoSuchMethodError: java.lang.NoSuchMethodError:
>     javax.media.j3d.Shape3D.setName(Ljava/lang/String;)V
>
>         at
>     org.python.core.PyException.fillInStackTrace(PyException.java:70)
>         at java.lang.Throwable.<init>(Throwable.java:181)
>         at java.lang.Exception.<init>(Exception.java:29)
>         at java.lang.RuntimeException.<init>(RuntimeException.java:32)
>         at org.python.core.PyException.<init>(PyException.java:46)
>         at org.python.core.PyException.<init>(PyException.java:43)
>         at org.python.core.Py.JavaError(Py.java:495)
>         at org.python.core.Py.JavaError(Py.java:488)
>         at
>     org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:188)
>         at org.python.core.PyObject.__call__(PyObject.java:345)
>         at
>     org.python.core.PyMethod.instancemethod___call__(PyMethod.java:220)
>         at org.python.core.PyMethod.__call__(PyMethod.java:211)
>         at org.python.core.PyMethod.__call__(PyMethod.java:201)
>         at
>     org.python.pycode._pyx0.f$0(/Users/amw1/Desktop/projects/tzachAuman/dog1.py:107)
>         at
>     org.python.pycode._pyx0.call_function(/Users/amw1/Desktop/projects/tzachAuman/dog1.py)
>         at org.python.core.PyTableCode.call(PyTableCode.java:165)
>         at org.python.core.PyCode.call(PyCode.java:18)
>         at org.python.core.Py.runCode(Py.java:1275)
>         at
>     org.scijava.plugins.scripting.jython.JythonScriptEngine.eval(JythonScriptEngine.java:76)
>         at org.scijava.script.ScriptModule.run(ScriptModule.java:174)
>         at org.scijava.module.ModuleRunner.run(ModuleRunner.java:167)
>         at org.scijava.module.ModuleRunner.call(ModuleRunner.java:126)
>         at org.scijava.module.ModuleRunner.call(ModuleRunner.java:65)
>         at
>     org.scijava.thread.DefaultThreadService$2.call(DefaultThreadService.java:191)
>         at
>     java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
>         at java.util.concurrent.FutureTask.run(FutureTask.java:138)
>         at
>     java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
>         at
>     java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
>         at java.lang.Thread.run(Thread.java:695)
>     Caused by: java.lang.NoSuchMethodError:
>     javax.media.j3d.Shape3D.setName(Ljava/lang/String;)V
>         at ij3d.shapes.BoundingBox.<init>(BoundingBox.java:66)
>         at ij3d.shapes.BoundingBox.<init>(BoundingBox.java:34)
>         at ij3d.shapes.BoundingBox.<init>(BoundingBox.java:30)
>         at ij3d.ContentInstant.display(ContentInstant.java:216)
>         at ij3d.ContentCreator.createContent(ContentCreator.java:111)
>         at ij3d.ContentCreator.createContent(ContentCreator.java:98)
>         at ij3d.Image3DUniverse.createContent(Image3DUniverse.java:1195)
>         at ij3d.Image3DUniverse.addCustomMesh(Image3DUniverse.java:1163)
>         at ij3d.Image3DUniverse.addIcospheres(Image3DUniverse.java:1285)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at
>     sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>         at
>     sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>         at java.lang.reflect.Method.invoke(Method.java:597)
>         at
>     org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:186)
>         ... 20 more
>
>
>     The print statement tell me that the Image3DUniverse object was
>     created, but any of the lines after that will cause
>     an error.
>
>
>         2) Test the new 3D Viewer based on Java 3D 1.6, downloadable
>         from here:
>         http://curtis.imagej.net/2015-10-06-jogl-java3d/
>         Which should work correctly with Java 8. (Feedback welcome!)
>
>     I downloaded this, and ran it.
>
>     Upon startup, it pops up the following message:
>     There are obsolete java 3D libraries installed as Java extensions.
>     The following were detected:
>     * /System/Library/Java/Extensions/3dcore.jar
>     * /System/Library/Java/Extensions/vecmath.jar
>     * /System/Library/Java/Extensions/j3dutils.jar
>     These libraries will very likely cause problems with 3D visualization.
>     Please delete them, then restart the program.
>
>
>     If I attempt to delete these files, I get the following message:
>     “j3dcore.jar” can’t be modified or deleted because it’s required
>     by OS X
>
>     If I proceed naively ahead, and I test java 3D
>     (Plugins>Utilites>Debugging>Test Java3D)
>     the I get the following:
>
>     java.lang.NoClassDefFoundError: Could not initialize class
>     javax.media.j3d.Canvas3D
>         at Test_Java3D.createPanel(Test_Java3D.java:34)
>         at Test_Java3D.run(Test_Java3D.java:25)
>         at ij.IJ.runUserPlugIn(IJ.java:212)
>         at ij.IJ.runPlugIn(IJ.java:176)
>         at ij.Executer.runCommand(Executer.java:132)
>         at ij.Executer.run(Executer.java:65)
>         at java.lang.Thread.run(Thread.java:745)
>
>
>     Best regards
>     --aryeh
>
>     --
>     Aryeh Weiss
>     Faculty of Engineering
>     Bar Ilan University
>     Ramat Gan 52900 Israel
>
>     Ph:  972-3-5317638
>     FAX: 972-3-7384051
>
>


--
Aryeh Weiss
Faculty of Engineering
Bar Ilan University
Ramat Gan 52900 Israel

Ph:  972-3-5317638
FAX: 972-3-7384051


--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html