<div dir="ltr">Hi Felix,<div><br></div><div>> <span style="font-family:arial,sans-serif">java.lang.NullPointerException</span></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>> at org.scijava.menu.ShadowMenu.addChild(ShadowMenu.java:532)</font></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="arial, sans-serif"><br></font></div><div style="font-family:arial,sans-serif;font-size:13px"><font face="arial, sans-serif">FWIW, I made a couple of fixes to avoid this problem:</font></div><div style><font face="arial, sans-serif" style="font-family:arial,sans-serif;font-size:13px">* </font><font face="arial, sans-serif"><a href="https://github.com/scijava/scijava-common/commit/bce7b69391791f39b5019dca14bf110816c97265">https://github.com/scijava/scijava-common/commit/bce7b69391791f39b5019dca14bf110816c97265</a></font></div><div style><font face="arial, sans-serif">* <a href="https://github.com/scijava/scijava-common/commit/93c340f472401567dee50f2edbb70abbff261749">https://github.com/scijava/scijava-common/commit/93c340f472401567dee50f2edbb70abbff261749</a></font></div><div style><font face="arial, sans-serif"><br></font></div><div style><font face="arial, sans-serif">These fixes made it into the scijava-common-2.35.1 release [1]. Give it a try if you have a chance.</font></div><div style><font face="arial, sans-serif"><br></font></div><div style><font face="arial, sans-serif">However, the fact that there were nulls involved there at all suggests another possible bug lurking elsewhere. I have not yet had time to investigate further, unfortunately.</font></div><div style><font face="arial, sans-serif"><br></font></div><div style><font face="arial, sans-serif">Regards,</font></div><div style><font face="arial, sans-serif">Curtis</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Oct 31, 2014 at 6:17 AM, MEYENHOFER Felix <span dir="ltr"><<a href="mailto:felix.meyenhofer@unifr.ch" target="_blank">felix.meyenhofer@unifr.ch</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">
Hi Curtis
<div><br>
</div>
<div>thanks for getting back to me. From a short look at the recent mails, it looks like you guys went through a considerable pile of work so you I am fully understanding this delay.</div>
<div><br>
</div>
<div>The option “Use SCIFIO when opening files” was checked in my case…</div>
<div>However I went ahead and tried to use a ImagePlus as input parameter. But the message dialog "<font face="arial, sans-serif">An ImgPlus is required, but none exists” persists. Now when I open some image first, I get the following
warning.</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>[WARNING] No widget found for input: imp</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><font face="arial, sans-serif">I should probably mention that when launching ImageJ (2.47) with the following lines:</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>final ImageJ ij = net.imagej.Main.launch(args);<br>
<span style="white-space:pre-wrap"></span>ij.command().run(Sanbox.class, true);</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><font face="arial, sans-serif">I get the error below:</font></div>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div><font face="arial, sans-serif">[ERROR] Exception during event handling:</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>[Event] org.scijava.module.event.ModulesUpdatedEvent</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>context = org.scijava.Context@71d382ab</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>consumed = false</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>items[0] = label='About ImageJ...', iconPath='/icons/commands/information.png', priority=0.0, enabled=true, pluginType=Command</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>items[1] = label='Preferences', priority=0.0, enabled=true, pluginType=Command</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>items[2] = label='Quit', iconPath='/icons/commands/door_in.png', priority=0.0, enabled=true, pluginType=Command</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>[Subscriber] org.scijava.menu.DefaultMenuService [priority = 0.0]</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>[Method] protected void org.scijava.menu.DefaultMenuService.onEvent(org.scijava.module.event.ModulesUpdatedEvent)</font></div>
<div><font face="arial, sans-serif">java.lang.NullPointerException</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.ShadowMenu.addChild(ShadowMenu.java:532)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.ShadowMenu.addChild(ShadowMenu.java:529)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.ShadowMenu.addChild(ShadowMenu.java:529)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.ShadowMenu.addChild(ShadowMenu.java:529)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.ShadowMenu.addChild(ShadowMenu.java:529)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.ShadowMenu.addChild(ShadowMenu.java:529)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.ShadowMenu.addChild(ShadowMenu.java:529)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.ShadowMenu.addInternal(ShadowMenu.java:478)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.ShadowMenu.addAll(ShadowMenu.java:351)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.ShadowMenu.<init>(ShadowMenu.java:117)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.DefaultMenuService.addModules(DefaultMenuService.java:154)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.DefaultMenuService.rootMenus(DefaultMenuService.java:179)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.menu.DefaultMenuService.onEvent(DefaultMenuService.java:118)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.lang.reflect.Method.invoke(Method.java:597)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.event.DefaultEventService$ProxySubscriber.onEvent(DefaultEventService.java:278)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.event.DefaultEventService$ProxySubscriber.onEvent(DefaultEventService.java:252)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.bushe.swing.event.ThreadSafeEventService.publish(ThreadSafeEventService.java:971)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.event.DefaultEventBus.access$101(DefaultEventBus.java:56)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.event.DefaultEventBus$1.run(DefaultEventBus.java:197)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at org.scijava.thread.DefaultThreadService$1.run(DefaultThreadService.java:147)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:715)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.EventQueue.access$400(EventQueue.java:82)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.EventQueue$2.run(EventQueue.java:676)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.EventQueue$2.run(EventQueue.java:674)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.security.AccessController.doPrivileged(Native Method)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:86)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.EventQueue.dispatchEvent(EventQueue.java:685)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)</font></div>
<div><font face="arial, sans-serif"><span style="white-space:pre-wrap"></span>at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
</blockquote>
<font face="arial, sans-serif">Sorry for throwing this stack-trace half investigated at you, but being a newbie in these matters, my hope i that you might tell me that I overlooked something obvious, before I go off looking at the wrong place
to resolve the issue at hand.</font><br>
<blockquote style="margin:0 0 0 40px;border:none;padding:0px">
<div><font face="arial, sans-serif"><br>
</font></div>
</blockquote>
<font face="arial, sans-serif">Best, regards, </font><span class="HOEnZb"><font color="#888888">
<div><font face="arial, sans-serif"><br>
</font></div>
</font></span><div><span class="HOEnZb"><font color="#888888"><font face="arial, sans-serif">Felix<br>
</font></font></span><div><div class="h5">
<div><br>
<div>
<blockquote type="cite">
<div>On 30 Oct 2014, at 18:51 , Curtis Rueden <<a href="mailto:ctrueden@WISC.EDU" target="_blank">ctrueden@WISC.EDU</a>> wrote:</div>
<br>
<div>
<div dir="ltr">Hi Felix,
<div><br>
</div>
<div>Apologies for the delay in reply. Due to work surrounding the ImgLib2 release, this is an exceptionally busy time.</div>
<div><br>
</div>
<div>> <span style="font-family:arial,sans-serif;font-size:13px">An ImgPlus is required, but none exists</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">The issue is that ImageJ2 uses the ImgPlus and Dataset classes for images, but ImageJ1 uses ij.ImagePlus. And the automatic conversion between these types is currently incomplete.
The "Enable ImageJ2 data structures" option of Edit > Options > ImageJ2 is intended to toggle this auto-conversion, but it currently has performance problems, so is off by default.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">We have a plan to address these issues, but it will be some time before the work can be completed.</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div>
<div><span style="font-family:arial,sans-serif;font-size:13px">Some related issues in the issue tracker:</span></div>
<div><font face="arial, sans-serif">* <a href="https://github.com/imagej/imagej-legacy/issues/95" target="_blank">
https://github.com/imagej/imagej-legacy/issues/95</a></font><br>
</div>
<div><span style="font-family:arial,sans-serif">*</span><span style="font-family:arial,sans-serif"> </span><font face="arial, sans-serif"><a href="https://github.com/imagej/imagej-legacy/issues/86" target="_blank">https://github.com/imagej/imagej-legacy/issues/86</a><br>
</font></div>
<div><span style="font-family:arial,sans-serif">*</span><span style="font-family:arial,sans-serif"> </span><font face="arial, sans-serif"><a href="https://github.com/imagej/imagej-legacy/issues/31" target="_blank">https://github.com/imagej/imagej-legacy/issues/31</a><br>
</font></div>
<div><span style="font-family:arial,sans-serif">*</span><span style="font-family:arial,sans-serif"> </span><font face="arial, sans-serif"><a href="https://github.com/imagej/imagej-legacy/issues/22" target="_blank">https://github.com/imagej/imagej-legacy/issues/22</a><br>
</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><font face="arial, sans-serif">In the meantime, it may be easier to use ImageJ 1.x's image data structure:</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><font face="arial, sans-serif"> @Parameter</font></div>
<div><font face="arial, sans-serif"> ImagePlus imp;</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div>Instead of the IJ2/ImgLib2 ones.</div>
<div><br>
</div>
<div>Regards,</div>
<div>Curtis</div>
</div>
<div class="gmail_extra"><br>
<div class="gmail_quote">On Wed, Oct 15, 2014 at 8:52 AM, MEYENHOFER Felix <span dir="ltr">
<<a href="mailto:felix.meyenhofer@unifr.ch" target="_blank">felix.meyenhofer@unifr.ch</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi<br>
<br>
during my first attempts of implementing a ij2 plugin I realised that the following point is not clear to me:<br>
thanks to the widget demo of the imagej-tutorials I managed to define my UI in the ij2-way. Now during my further research to find a way to easily define an image input and getting the dialog with the Parameter decorator I found examples like<br>
<br>
@Parameter(type = ItemIO.INPUT)<br>
private ImgPlus<FloatType> img;<br>
or<br>
@Parameter(type = ItemIO.INPUT)<br>
private Dataset ds;<br>
<br>
but when running such code I get a warning-dialog saying; “An ImgPlus is required, but none exists”<br>
So I open an image and run the plugin again. The same dialog appears again.<br>
All the other types work well (String, File, etc.). Is this a bug or am I missing something.<br>
<br>
Best regards,<br>
<br>
Felix<br>
_______________________________________________<br>
ImageJ-devel mailing list<br>
<a href="mailto:ImageJ-devel@imagej.net" target="_blank">ImageJ-devel@imagej.net</a><br>
<a href="http://imagej.net/mailman/listinfo/imagej-devel" target="_blank">http://imagej.net/mailman/listinfo/imagej-devel</a><br>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div></div></div>
</div>
</blockquote></div><br></div>