These are chat archives for fiji/fiji

15th
Jun 2018
Hadrien Mary
@hadim
Jun 15 2018 00:05
I understand :-)
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 19:56

For fiji-nojre I see these launchers:

  • ImageJ-linux32
  • ImageJ-linux64
  • ImageJ-win32.exe
  • ImageJ-win64.exe

What is the launcher for osx?

Curtis Rueden
@ctrueden
Jun 15 2018 19:59
Contents/MacOS/ImageJ-macosx
There was some technical reason(s) it couldn't live in the base folder, IIRC.
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 20:00
:plus1: thanks
Stefan Helfrich
@stelfrich
Jun 15 2018 20:00
Is the forum down or is it just me?
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 20:01
works for me @stelfrich
Curtis Rueden
@ctrueden
Jun 15 2018 20:01
@stelfrich I just upgraded it.
As such, it was down for a few moments.
Stefan Helfrich
@stelfrich
Jun 15 2018 20:25
Works again. Thanks!
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 21:51

@ctrueden I created conda build scripts for fiji and imagey and added packages for linux to my conda channel:

conda create -n imagey -c hanslovsky imagey imglib2-imglyb fiji
conda activate imagey
imagey

works on linux. There are two major issues right now:

  • the menu entry for the cpython interpreter does not show up (it should show in modern mode). As a workaround I show the console on start-up (but there is no way to retrieve it once it is closed/hidden). Maybe you see something that I am doing wrong here
  • I cannot open numpy comptabile images anymore (c&p from CPython imagey console):
try:
    open_imgs(path)
except JavaException as e:
    print(e.innermessage)
    print(e.classname)
    for st in e.stacktrace:
        print(st)

None
java.lang.NullPointerException
java.lang.NullPointerException
net.imagej.ImgPlus.createAxes(ImgPlus.java:433)
net.imagej.ImgPlus.<init>(ImgPlus.java:134)
net.imagej.ImgPlus.<init>(ImgPlus.java:128)
io.scif.img.SCIFIOImgPlus.<init>(SCIFIOImgPlus.java:89)
io.scif.img.ImgOpener.makeImgPlus(ImgOpener.java:502)
io.scif.img.ImgOpener.openImgs(ImgOpener.java:330)
io.scif.img.ImgOpener.openImgs(ImgOpener.java:201)
io.scif.img.ImgOpener.openImgs(ImgOpener.java:182)

I suspect that this is related to the imglib2-v5 update (I set the Type t in my ImgFactory to null for now, so maybe that's the cause. I will investigate on that one.

Philipp Hanslovsky
@hanslovsky
Jun 15 2018 21:59
I do think that the img that is passed as argumente here is null. gotta find out why
Curtis Rueden
@ctrueden
Jun 15 2018 22:00
@hanslovsky Thanks for the update. Remind me why you need to be in modern mode again?
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 22:01
As far as I remember that was to add commands to the menu when the jvm is already running
Curtis Rueden
@ctrueden
Jun 15 2018 22:01
As for the menu entry not appearing: your code looks reasonable. The addModule should trigger an event that causes the menu structure to update. But... maybe not in legacy mode.
To be precise: to update the menus after the SciJava Context is created, no?
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 22:02
Yes, I think so
Let me see if there is an issue on imagey
Curtis Rueden
@ctrueden
Jun 15 2018 22:03
One workaround would be to create your command_info and add that to the PluginIndex which you then feed to the Context constructor. This is slightly annoying, but would avoid the need for a menu change to propagate.
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 22:04
No issue on imagey so I guess after creation of the context was the reason, yes.
Curtis Rueden
@ctrueden
Jun 15 2018 22:05
So something like (untested):
plugin_index = PluginIndex()
plugin_index.add(command_info)
context = Context(plugin_index)
ij = ImageJ(context)
We should fix the menu refreshing to actually work, but the above would avoid it.
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 22:05
I will try that and let you know
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 22:18
@ctrueden the line context = Context(plugin_index) fails:
Traceback (most recent call last):
  File "imagey/imagey.py", line 237, in run_on_start
    context      = Context(plugin_index)
  File "jnius/jnius_export_class.pxi", line 253, in jnius.JavaClass.__init__
  File "jnius/jnius_export_class.pxi", line 332, in jnius.JavaClass.call_constructor
  File "jnius/jnius_utils.pxi", line 93, in jnius.check_exception
jnius.JavaException: JVM exception occurred: Invalid service: net.imagej.legacy.LegacyConsoleService
Curtis Rueden
@ctrueden
Jun 15 2018 22:23
@hanslovsky Are there two contexts simultaneously?
Also, I eliminated the LegacyConsoleService in the latest imagej-legacy. I think not yet released. But you could try the snapshot.
Sorry, bus ride almost over; I have to go. I'll try to check in with you again on Monday.
imagej/imagej-legacy@28be1c5
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 22:24
None that I am aware of
I'll get the full java stacktrace
Curtis Rueden
@ctrueden
Jun 15 2018 22:24
Are you using ij.init? If so, that creates a context.
You could call dispose() on it first, before making another one.
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 22:24
java.lang.IllegalArgumentException: Invalid service: net.imagej.legacy.LegacyConsoleService
org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:281)
org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:232)
org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:195)
org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:167)
org.scijava.Context.<init>(Context.java:281)
org.scijava.Context.<init>(Context.java:237)
org.scijava.Context.<init>(Context.java:213)
Caused by:
java.lang.IllegalArgumentException: Invalid service: net.imagej.legacy.LegacyService
org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:281)
org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:232)
org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:341)
org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:270)
org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:232)
org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:195)
org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:167)
org.scijava.Context.<init>(Context.java:281)
org.scijava.Context.<init>(Context.java:237)
org.scijava.Context.<init>(Context.java:213)
Caused by:
java.lang.NullPointerException
net.imagej.legacy.LegacyService.getScriptsAndNonLegacyCommands(LegacyService.java:667)
net.imagej.legacy.IJ1Helper.addMenuItems(IJ1Helper.java:802)
net.imagej.legacy.LegacyService.initialize(LegacyService.java:517)
org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:354)
org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:270)
org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:232)
org.scijava.service.ServiceHelper.createServiceRecursively(ServiceHelper.java:341)
org.scijava.service.ServiceHelper.createExactService(ServiceHelper.java:270)
org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:232)
org.scijava.service.ServiceHelper.loadService(ServiceHelper.java:195)
org.scijava.service.ServiceHelper.loadServices(ServiceHelper.java:167)
org.scijava.Context.<init>(Context.java:281)
org.scijava.Context.<init>(Context.java:237)
org.scijava.Context.<init>(Context.java:213)
I am using the lines that you posted:
plugin_index = PluginIndex()
plugin_index.add(command_info)
context = Context(plugin_index)
ij = ImageJ(context)
I don't create any Context or ImageJ before that
Curtis Rueden
@ctrueden
Jun 15 2018 22:26
OK. Sorry I don't have any other immediate ideas.
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 22:26
will check with the snapshot
Curtis Rueden
@ctrueden
Jun 15 2018 22:26
That NPE is suspicious... sorry gotta go! TTYL
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 22:27
see you
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 22:33
@ctrueden I replaced the imagej-legacy jar with the SNAPSHOT version and now it works! (I will also try without setting the context explicitly)
imagej starts in modern mode now - is that expected?
@ctrueden Yep, that works as well now
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 22:47
@ctrueden The issue with the null pointer when opening images was related to the new ImgFactory design in imglib2-v5, as expected. I require now to pass a NativeType to my open_img convenience method to create the appropriate typed factory.
Is there a way to determine the "correct" type for an image just from a path/url without loading the img?
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 23:00
With the updated imagej-legacy jar and my adapations in imagey.py everything works again!
Philipp Hanslovsky
@hanslovsky
Jun 15 2018 23:38
@ctrueden Do you have a timeline for propagating current imagej-legacy master into fiji?
Curtis Rueden
@ctrueden
Jun 15 2018 23:57
@hanslovsky I released imagej-legacy 0.32.0 from the latest master. I will include it in a Fiji update by end of next week. There needs to be an update of ImageJ2 core anyway, to roll out some critical updates to SCIFIO.