NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 930 - variable result containing an array gives an error
variable result containing an array gives an error
Status: CONFIRMED
Product: Fiji
Classification: Unclassified
Component: Plugins
unspecified
PC Linux
: P4 normal
Assigned To: ImageJ Bugs Mailing List
Depends on:
Blocks:
 
Reported: 2014-09-12 08:48 CDT by Volker
Modified: 2014-09-13 04:16 CDT
4 users (show)

See Also:

Description Volker 2014-09-12 08:48:33 CDT
Running the ImageJ1 macro 

result = newArray(3);

in FIJI, gives an error. It works fine in ImageJ.

Information about your version of Java:

  os.arch => amd64
  os.name => Linux
  os.version => 3.13.0-35-generic
  java.version => 1.6.0_24
  java.vendor => Sun Microsystems Inc.
  java.runtime.name => Java(TM) SE Runtime Environment
  java.runtime.version => 1.6.0_24-b07
  java.vm.name => Java HotSpot(TM) 64-Bit Server VM
  java.vm.version => 19.1-b02
  java.vm.vendor => Sun Microsystems Inc.
  java.vm.info => mixed mode
  java.awt.graphicsenv => sun.awt.X11GraphicsEnvironment
  java.specification.name => Java Platform API Specification
  java.specification.version => 1.6
  sun.cpu.endian => little
  sun.desktop => gnome
  file.separator => /

The up-to-date check says: REMIND_LATER

Information relevant to JAVA_HOME related problems:

  JAVA_HOME is set to: /home/baecker/programs/Fiji.app/java/linux-amd64/jdk1.6.0_24//jre
  imagej.dir => /home/baecker/programs/Fiji.app

Information about the version of each plugin:

Activated update sites:
ImageJ: http://update.imagej.net/ (last check:20140911002552)
Fiji: http://fiji.sc/update/ (last check:20140911164641)
GDSC-SMLM: http://sites.imagej.net/GDSC-SMLM/ (last check:20140901184458)

Files not up-to-date:
  ca9bc7b4 (LOCAL_ONLY) 20110307150953 jars/Fiji.jar
  654950d5 (LOCAL_ONLY) 20140731133439 macros/FilterTester.txt
  169c22e6 (LOCAL_ONLY) 20140731133429 macros/RegressionTests.txt
  9c0ae1d2 (LOCAL_ONLY) 20120910154140 macros/toolsets/MRI_Microtubules_Tools.ijm
  9304e645 (LOCAL_ONLY) 20140619135051 macros/toolsets/SMLM Tools.txt
  f7efa1b3 (LOCAL_ONLY) 20110307151005 misc/headless.jar
  c38a9468 (LOCAL_ONLY) 20121025094748 plugins/Example02_CallCommand.class
  264252a5 (MODIFIED) 20120831160624 plugins/Macros/Bulls_Eye.txt
  985c24c7 (LOCAL_ONLY) 20140514132013 plugins/Macros/MRI_Microtubules_Tools.ijm
  4fe1cfd7 (LOCAL_ONLY) 20140619151041 plugins/SNR_.jar
  57093f4e (LOCAL_ONLY) 20090227205050 plugins/Tools/LiveWire.txt
  8417d1c5 (LOCAL_ONLY) 20090227204954 plugins/Tools/LiveWire1DTool_.class
  467c93ff (LOCAL_ONLY) 20090227201012 plugins/Tools/LiveWire2DTool_.class
  4cbd6295 (LOCAL_ONLY) 20090227204948 plugins/Tools/LiveWireTool.class
  08e62257 (LOCAL_ONLY) 20090227215826 plugins/Tools/README-LiveWire.txt
  fef778a5 (LOCAL_ONLY) 20090227201012 plugins/Tools/ij/gui/ERoi.class
  4f642379 (LOCAL_ONLY) 20090227201012 plugins/Tools/livewire/Dijkstraheap.class
  6c92da1c (LOCAL_ONLY) 20090227201012 plugins/Tools/livewire/LiveWire$1.class
  06ec1e9a (LOCAL_ONLY) 20090227201012 plugins/Tools/livewire/LiveWire$2.class
  ef10fc8c (LOCAL_ONLY) 20090227201012 plugins/Tools/livewire/LiveWire$3.class
  42f3af5e (LOCAL_ONLY) 20090227201012 plugins/Tools/livewire/LiveWire$4.class
  fd4e5f76 (LOCAL_ONLY) 20090227201012 plugins/Tools/livewire/LiveWire$5.class
  20586688 (LOCAL_ONLY) 20090227201012 plugins/Tools/livewire/LiveWire.class
  c2ef8a36 (LOCAL_ONLY) 20090227201012 plugins/Tools/livewire/PixelNode.class
  a5296dfa (LOCAL_ONLY) 20090227201010 plugins/Tools/livewire/Vector2d.class
  ec17890b (LOCAL_ONLY) 20131104155444 plugins/omero/libs/JHotDraw.jar
  91ece67d (LOCAL_ONLY) 20131128104658 plugins/omero/libs/JWlz.jar
  36cb5c0a (LOCAL_ONLY) 20131104155444 plugins/omero/libs/TableLayout.jar
  ff61a1b4 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/ai_path.jar
  c3a86bd0 (LOCAL_ONLY) 20131104155522 plugins/omero/libs/assumeng.jar
  364315a9 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/axis.jar
  0af1624e (LOCAL_ONLY) 20131104155444 plugins/omero/libs/backport-util-concurrent.jar
  6912f440 (LOCAL_ONLY) 20140403210120 plugins/omero/libs/blitz.jar
  189f61fa (LOCAL_ONLY) 20131104155444 plugins/omero/libs/bufr.jar
  031cc2a6 (LOCAL_ONLY) 20140403205940 plugins/omero/libs/common.jar
  940245e0 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/commons-codec.jar
  64d8a654 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/commons-collections.jar
  86ab9004 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/commons-digester.jar
  9e9eb622 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/commons-discovery.jar
  c62bea1b (LOCAL_ONLY) 20131104155444 plugins/omero/libs/commons-httpclient.jar
  d59d3e4c (LOCAL_ONLY) 20131104155444 plugins/omero/libs/commons-io.jar
  f6139801 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/commons-lang.jar
  7018824c (LOCAL_ONLY) 20131104155444 plugins/omero/libs/commons-logging.jar
  60a83b54 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/commons-validator.jar
  abf211c5 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/ehcache-core.jar
  991b5e8a (LOCAL_ONLY) 20131104155444 plugins/omero/libs/gicentreUtils.jar
  dbcde867 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/gluegen-rt.jar
  e33cecc2 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/grib.jar
  ac0dfbec (LOCAL_ONLY) 20131104155444 plugins/omero/libs/guava-jdk5.jar
  85c28658 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/hibernate-jpa-2.0-api.jar
  1911c9e1 (LOCAL_ONLY) 20131120130114 plugins/omero/libs/ice-glacier2.jar
  b1d709fb (LOCAL_ONLY) 20131120130114 plugins/omero/libs/ice-grid.jar
  c49b8fa2 (LOCAL_ONLY) 20131120130114 plugins/omero/libs/ice-storm.jar
  53aa5393 (LOCAL_ONLY) 20131120130114 plugins/omero/libs/ice.jar
  6e7614ee (LOCAL_ONLY) 20131104155444 plugins/omero/libs/ij.jar
  6ce638fb (LOCAL_ONLY) 20131104155444 plugins/omero/libs/ini4j.jar
  f1b65457 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/java-getopt.jar
  c827227f (LOCAL_ONLY) 20131104155444 plugins/omero/libs/java-image-scaling.jar
  e72f9b2b (LOCAL_ONLY) 20131104155444 plugins/omero/libs/jaxrpc.jar
  4156c7b5 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/jcommon.jar
  c57f20b0 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/jfreechart.jar
  df7a0b63 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/jna.jar
  4c09d41c (LOCAL_ONLY) 20131104155522 plugins/omero/libs/joda-time.jar
  9a9b947a (LOCAL_ONLY) 20131104155444 plugins/omero/libs/jogl.jar
  d2af3ac9 (LOCAL_ONLY) 20131104155522 plugins/omero/libs/kryo.jar
  b2911375 (LOCAL_ONLY) 20140403205856 plugins/omero/libs/lwf-stubs.jar
  0f7b1b81 (LOCAL_ONLY) 20140403205936 plugins/omero/libs/model-psql.jar
  a127d67c (LOCAL_ONLY) 20131104155444 plugins/omero/libs/nanoxml.jar
  e1a35a80 (LOCAL_ONLY) 20131104155522 plugins/omero/libs/native-lib-loader.jar
  a51a31db (LOCAL_ONLY) 20131128104658 plugins/omero/libs/netcdf.jar
  e665d66a (LOCAL_ONLY) 20131104155444 plugins/omero/libs/ols-client.jar
  18382f06 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/ome-java.jar
  7af6ddeb (LOCAL_ONLY) 20131104155522 plugins/omero/libs/perf4j.jar
  6340be70 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/physics.jar
  b3056152 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/platform.jar
  4ef2cfd3 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/poi.jar
  af4b3176 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/processing-controlP5.jar
  1cb045e1 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/processing-core.jar
  2e6cf711 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/saaj.jar
  eedc0cd9 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/serializer.jar
  5085d943 (LOCAL_ONLY) 20140401124614 plugins/omero/libs/slf4j-api.jar
  1deeabc9 (LOCAL_ONLY) 20140403205852 plugins/omero/libs/specification.jar
  ba32bfdf (LOCAL_ONLY) 20131104155444 plugins/omero/libs/swingx.jar
  7c4005e7 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/wsdl4j.jar
  c8694e76 (LOCAL_ONLY) 20131104155444 plugins/omero/libs/xalan.jar
  56926bee (LOCAL_ONLY) 20140403210440 plugins/omero/omero_ij.jar
  926b71b3 (LOCAL_ONLY) 20140326180812 plugins/spiral/Batch_Process_Cellomics_Mosaics.bsh
  3b2c92dd (LOCAL_ONLY) 20140704153331 plugins/spiral/Batch_Process_Cellomics_Timeseries_Mosaics.bsh
  bade15d7 (LOCAL_ONLY) 20140326145451 plugins/spiral/Create_Spiral_Image.bsh
  d3260180 (LOCAL_ONLY) 20110303204101 scripts/Record_Desktop.py
  0ea7f8fc (LOCAL_ONLY) 20110303204101 scripts/Record_Window.py
Comment 1 Mark Hiner 2014-09-12 10:24:30 CDT
Confirmed. The error message is:

'[' or '.' expected


This comes from IJ1 helper passing the macro:

result = -17974594
result = newArray(3);call("net.imagej.legacy.plugin.IJ1MacroEngine.setOutput", "result", result);

to IJ.runMacro, which errors out when attempting to look up the value of the result variable here:

https://github.com/imagej/ImageJA/blob/master/src/main/java/ij/macro/Interpreter.java#L1629-1648

Looks like it's wants to evaluate an index of the array instead of just returning the array itself.

Note that storing the array into a different variable name seems to be fine (no exception at least). e.g.:

test = newArray(3);
Comment 2 Johannes Schindelin 2014-09-12 10:41:15 CDT
Volker, I just wasted 10 minutes studying http://imagej.net/developer/macro/functions.html for any way to determine the type of a variable; there seems not to be any.

Feel free to dig deeper and come up with a way to determine -- in ImageJ 1.x' macro language -- whether a given variable is a string or a number (which we would need to support your use case).

Until we have such a method, I am afraid I have to mark this with a WONTFIX.
Comment 3 Curtis Rueden 2014-09-12 11:39:14 CDT
I think we _have_ to fix this. Otherwise, any existing macros that use newArray will no longer work in Fiji.
Comment 4 Johannes Schindelin 2014-09-13 04:16:10 CDT
Fiji is a *community* effort, and Volker is a quite capable developer. Let's include him in the process of fixing this bug instead of excluding him.