labsyspharm / basic-illumination

ImageJ BaSiC shading correction for use with Ashlar
MIT License
8 stars 10 forks source link

java.lang.IllegalArgumentException: Unclosed string literal at index 1 #5

Open huanlity opened 2 years ago

huanlity commented 2 years ago

Hi All,

I was helping one of my colleagues to troubleshoot this error message when running the illumination correction using BASIC but did not get any luck, do you have any suggestion? Thanks!

command executed: docker run --rm -it --user root -v /home/bkang/store/HTAN/src_v1/HTA5_1597_1603/:/data/ labsyspharm/basic-illumination bash ImageJ-linux64 --ij2 --headless --run imagej_basic_ashlar_filepattern.py \"pattern='/data/raw/cycle0/Cycle_0_F*.tif',output_dir='/data/illumination/', experiment_name='cycle0'\" > /data/illumination/illumination0.log

error: Screen Shot 2022-01-26 at 11 29 50 AM

Thanks, Huan

jmuhlich commented 2 years ago

This is just a Bash string quoting problem -- you need to remove the backslashes before the double-quotes surrounding the macro arg string. Otherwise the actual string that ImageJ "sees" still has the double-quotes around it which is not part of the allowable syntax for macro args.

huanlity commented 2 years ago

@jmuhlich After the change you suggested, he got another Java error:

root@545a3ce99e26:/opt/fiji# ImageJ-linux64 --ij2 --headless --run imagej_basic_ashlar_filepattern.py "pattern='/data/raw/cycle0/Cycle_0_F*.tif',output_dir='/data/illumination/', exper iment_name='cycle0'" > /data/illumination/illumination0.log

OpenJDK 64-Bit Server VM warning: ignoring option PermSize=128m; support was removed in 8.0 OpenJDK 64-Bit Server VM warning: Using incremental CMS is deprecated and will likely be removed in a future release [ERROR] null Traceback (most recent call last): File "imagej_basic_ashlar_filepattern.py", line 186, in main() File "imagej_basic_ashlar_filepattern.py", line 147, in main image = opener.openImage(filename, *args) at ij.io.Opener.openTiff(Opener.java:873) at ij.io.Opener.openImage(Opener.java:257) at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) java.lang.IllegalArgumentException: java.lang.IllegalArgumentException: N out of 1-2 range

    at org.python.core.Py.JavaError(Py.java:552)
    at org.python.core.Py.JavaError(Py.java:543)
    at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java:190)
    at org.python.core.PyObject.__call__(PyObject.java:438)
    at org.python.core.PyMethod.instancemethod___call__(PyMethod.java:237)
    at org.python.core.PyMethod.__call__(PyMethod.java:228)
    at org.python.core.PyMethod.__call__(PyMethod.java:223)
    at org.python.core.PyObject._callextra(PyObject.java:620)
    at org.python.pycode._pyx0.main$2(imagej_basic_ashlar_filepattern.py:183)
    at org.python.pycode._pyx0.call_function(imagej_basic_ashlar_filepattern.py)
    at org.python.core.PyTableCode.call(PyTableCode.java:171)
    at org.python.core.PyBaseCode.call(PyBaseCode.java:125)
    at org.python.core.PyFunction.__call__(PyFunction.java:403)
    at org.python.pycode._pyx0.f$0(imagej_basic_ashlar_filepattern.py:186)
    at org.python.pycode._pyx0.call_function(imagej_basic_ashlar_filepattern.py)
    at org.python.core.PyTableCode.call(PyTableCode.java:171)
    at org.python.core.PyCode.call(PyCode.java:18)
    at org.python.core.Py.runCode(Py.java:1614)
    at org.python.core.__builtin__.eval(__builtin__.java:497)
    at org.python.core.__builtin__.eval(__builtin__.java:501)
    at org.python.util.PythonInterpreter.eval(PythonInterpreter.java:259)
    at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:57)
    at org.python.jsr223.PyScriptEngine.eval(PyScriptEngine.java:31)
    at javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264)
    at org.scijava.script.ScriptModule.run(ScriptModule.java:160)
    at org.scijava.module.ModuleRunner.run(ModuleRunner.java:168)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:127)
    at org.scijava.module.ModuleRunner.call(ModuleRunner.java:66)
    at org.scijava.thread.DefaultThreadService$3.call(DefaultThreadService.java:238)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

Caused by: java.lang.IllegalArgumentException: N out of 1-2 range at ij.io.Opener.openTiff(Opener.java:873) at ij.io.Opener.openImage(Opener.java:257) at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.python.core.PyReflectedFunction.call(PyReflectedFunction.java:188) ... 30 more

jmuhlich commented 2 years ago

Could you share at least one of your tile images? I'll need to step through the code with your image loaded to see what's going on. You can reach out privately to share it if you'd prefer not to attach it here.

huanlity commented 2 years ago

Could you share at least one of your tile images? I'll need to step through the code with your image loaded to see what's going on. You can reach out privately to share it if you'd prefer not to attach it here.

I just shared some data with your via Google. Thank you!