I am new to FIJI/ImageJ and a novice at macro programming. I’ve
managed to throw together a basic image analysis macro to measure
various parameters from JPGs or TIFs.
It is supposed to open an image file, perform the measurements, then
save the overlays and results tables before closing all the windows in
preparation for running the macro again. I can post the macro if it
On the whole it works well, but for some reason after I run it a
couple of times, it returns the error message, “Undefined variable in
line 1”, then something in triangular brackets (e.g. JFIF), followed by
what looks suspiciously like some of the file metadata (e.g. ‘Hamamatsu
JPEG library version xxx’, where Hamamatus is the name of the slide
scanner I used).
The puzzling thing (for me at least) is that line 1 is merely
…and the macro at first seems to work perfectly once or twice. If I
restart FIJI, it again works perfectly once or twice before returning a
If I delete the ‘Open’ command it does seem to work, but I’d like to
keep ‘Open’ because I’m using the rename(File.nameWithoutExtension)'
command to rename the image file for saving, and if I don’t use 'Open’
then it gets renamed with the name of the macro instead (hope that makes
I would really appreciate any insights / suggestions - I’ve no idea
if this is me making some sort of rookie error, or some weird bug
preventing the macro from working more than a couple of times…