Error drag and drop with Groovy scripts


#1

Hello everyone,

I have a strange behavior using the script editor with Groovy scripts: when I drag and drop my file onto the ImageJ bar, I get the following error. I have no problem if I open it directly from the script editor, or if I drag and drop bsh or ijm scripts.

(Fiji Is Just) ImageJ 2.0.0-rc-43/1.51j; Java 1.8.0_111 [64-bit]; Windows 7 6.1; 33MB of 6033MB (<1%)
 
java.lang.NoSuchFieldError: MICROMETER
	at loci.formats.in.NiftiReader.<init>(NiftiReader.java:80)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at java.lang.Class.newInstance(Unknown Source)
	at loci.formats.ImageReader.<init>(ImageReader.java:129)
	at loci.formats.in.FilePatternReader.<init>(FilePatternReader.java:79)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at java.lang.Class.newInstance(Unknown Source)
	at loci.formats.ImageReader.<init>(ImageReader.java:129)
	at loci.plugins.util.LociPrefs.makeImageReader(LociPrefs.java:91)
	at loci.plugins.in.ImportProcess.createBaseReader(ImportProcess.java:617)
	at loci.plugins.in.ImportProcess.initializeReader(ImportProcess.java:484)
	at loci.plugins.in.ImportProcess.execute(ImportProcess.java:137)
	at loci.plugins.in.Importer.showDialogs(Importer.java:140)
	at loci.plugins.in.Importer.run(Importer.java:76)
	at loci.plugins.LociImporter.run(LociImporter.java:78)
	at ij.IJ.runUserPlugIn(IJ.java:217)
	at ij.IJ.runPlugIn(IJ.java:181)
	at ij.IJ.runPlugIn(IJ.java:170)
	at HandleExtraFileTypes.openImage(HandleExtraFileTypes.java:499)
	at HandleExtraFileTypes.run(HandleExtraFileTypes.java:72)
	at ij.IJ.runUserPlugIn(IJ.java:217)
	at ij.IJ.runPlugIn(IJ.java:181)
	at ij.IJ.runPlugIn(IJ.java:170)
	at ij.io.Opener.openWithHandleExtraFileTypes(Opener.java:515)
	at ij.io.Opener.openImage(Opener.java:369)
	at ij.io.Opener.openImage(Opener.java:243)
	at ij.io.Opener.open(Opener.java:110)
	at ij.io.Opener.openAndAddToRecent(Opener.java:292)
	at ij.plugin.DragAndDrop.openFile(DragAndDrop.java:192)
	at ij.plugin.DragAndDrop.run(DragAndDrop.java:159)
	at java.lang.Thread.run(Unknown Source)

#2

Dear @Nicolas,

it seems like the file gets interpreted as image and the opening is redirected to Bio-Formats (loci.formats.ImageReader.<init>). Could you please check if the same thing happens with a Jython script (just use any one from the Templates menu in the Script Editor)? I am asking this since I can’t reproduce the issue on my machine.

Also, it seems that you Fiji installation is not completely up-to-date (current release of if ImageJ is 2.0.0-rc-56). Thus, could check if the issue remains after updating?

Best,
Stefan


Bio-Formats exception on.zvi read
#3

Hello @stelfrich,
thank you for your help. I updated Fiji, but the version is still stuck to rc-43.
Besides, for some reason, I don’t have the Jython language in the script editor.
A few months ago, I reorganized some menus in my Fiji distribution, and got rid of some options that looked unnecessary to my work (Customize menus in Fiji). I’m hope I didn’t do anything irreversible…


#4

Do you have the Java-8 update site enabled?

Could you re-download Fiji and check if drag&drop works on that fresh installation or if the issue persists?


#5

Thank you, that works again and Fiji is now at rc-46!


#6

I hope it’s a typo and it is at rc-56 :wink:

While that solves the problem, I’d feel better if we knew what caused that hiccup to be able to prevent it in future. If you are going to customize that fresh Fiji installation again, it would be super helpful to know which operation broke the drag & drop.

Best,
Stefan


#7

Hm, sure, it’s a typo.
Actually, that works, but the code opens in the old script editor (IJ1, I guess). But I’m fine with that, I can open the new editor myself.
And it also works the same way with my customized distribution of Fiji, so my modifications were not the cause of the problem.
Thank you for your help!

Nicolas


#8

I can confirm this: .groovy files dragged onto the Fiji toolbar will open in a normal TextWindow, not in the script editor.

I opened an issue to keep track of this.


#9

I have the same error while trying to open .lif files (fluorescence images from the Leica DM High Content), but the solution doesn’t work with me


#10

Since you opened this new topic, let’s continue the discussion there: