Login  Register

HELP - Changing image focus in between macro calls

Posted by Daniel Kalthoff on May 09, 2011; 1:13pm
URL: http://imagej.273.s1.nabble.com/HELP-Changing-image-focus-in-between-macro-calls-tp3684655.html

Dear Community,

I am facing a problem with irreproducible behaviour of ImageJ macro calls involving resizing, cropping, duplicating etc.
It seems that some of these routines silently change the focus, i.e. the image processed will loose the focus and subsequent calls will erroneously manipulate another image. I am running ImageJ 1.45g on a MacBook with MacOS 10.6.7. I have, however, also faced similar problems on Windows systems.

I have put together a short macro that illustrates the problem:

> run("Bat Cochlea Volume (19K)");
> run("MRI Stack (528K)");
> run("Size...", "width=100 height=121 depth=20 constrain average interpolation=Bilinear");
> write(getTitle());

After a couple of runs (subsequently closing all open images after each run), the log window looks like this

> mri-stack.tif
> mri-stack.tif
> bat-cochlea-volume.tif
> bat-cochlea-volume.tif
> bat-cochlea-volume.tif
> mri-stack.tif
> mri-stack.tif
> mri-stack.tif
> bat-cochlea-volume.tif

Any ideas?

Thanks in advance!

Daniel