Headless path issue

linux
Tags: #<Tag:0x00007fb87b8c0ab0>

#1

Hi All,

I am having a problem running Fiji/ImageJ headless on a linux server. I am trying to call a macro but when I run my script

/cm/shared/apps/fiji/ImageJ-linux64 --headless -macro SquasshX.txt

I get the info at the bottom. I know the macro is there and is correctly spelled etc. I have also tried including the full path which does not work either and I have tried it in multiple locations.

Thoughts?

Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
Macro or script not found:
 
/cm/shared/apps/fiji/macros/SquasshX.txt
Error while executing the main() method of class 'net.imagej.Main':
java.lang.RuntimeException: Macro canceled
	at ij.Macro.abort(Macro.java:76)
	at ij.IJ.error(IJ.java:658)
	at ij.plugin.Macro_Runner.runMacroFile(Macro_Runner.java:125)
	at ij.IJ.runMacroFile(IJ.java:152)
	at net.imagej.legacy.IJ1Helper$4.call(IJ1Helper.java:1113)
	at net.imagej.legacy.IJ1Helper$4.call(IJ1Helper.java:1109)
	at net.imagej.legacy.IJ1Helper.runMacroFriendly(IJ1Helper.java:1043)
	at net.imagej.legacy.IJ1Helper.runMacroFile(IJ1Helper.java:1109)
	at net.imagej.legacy.LegacyCommandline$Macro.handle(LegacyCommandline.java:187)
	at org.scijava.console.DefaultConsoleService.processArgs(DefaultConsoleService.java:102)
	at net.imagej.legacy.LegacyConsoleService.processArgs(LegacyConsoleService.java:81)
	at org.scijava.AbstractGateway.launch(AbstractGateway.java:96)
	at net.imagej.Main.main(Main.java:55)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:497)
	at net.imagej.launcher.ClassLauncher.launch(ClassLauncher.java:279)
	at net.imagej.launcher.ClassLauncher.run(ClassLauncher.java:186)
	at net.imagej.launcher.ClassLauncher.main(ClassLauncher.java:77)

#2

Dear @cnavara,

Did you also check the permissions for that particular file? What’s the output of ls -l /cm/shared/apps/fiji/macros/|grep SquasshX?

Best,
Stefan


#3

Just another suggestion in addition to @stelfrich, what happens if you give the full path to the macro as argument, something like:

cm/shared/apps/fiji/ImageJ-linux64 --headless -macro /yourPath/SquasshX.txt


#4

Here is the output

-rw-r–r-- 1 root root 466 Apr 5 09:30 SquasshX.txt

I assume it just needs read permission. Is that correct?


#5

Try renaming SquasshX.txt to SquasshX.ijm?


#6

The full path doesn’t work either. I have tried putting it in the macros folder and directing the path there as well as having it in the directory with the images I want to process and pointing the path there.

Thanks


#7

That’s correct. I can’t reproduce your issue on Ubuntu 16.04:

➜  ~ ls -lah /opt/Fiji/Fiji.app | grep test
-rw-r--r--  1 root   root     20 Apr 10 07:12 test.txt
➜  ~ cat /opt/Fiji/Fiji.app/test.txt
print("Something");
➜  ~ /opt/Fiji/Fiji.app/ImageJ-linux64 --headless -macro /opt/Fiji/Fiji.app/test.txt 
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release
Something 

Are you also starting ImageJ-linux64 as root or as another user?


#8

We have solved (sort of) the locating the macro problem. I was providing the full path to ImageJ and for whatever reason it was then looking for the full provided macro path inside the macro folder. We now load the module and then just call ImageJ without the path and it works either with the macro in the macro folder or wherever I point it too.