Posted by
Krs5 on
May 09, 2011; 3:00pm
URL: http://imagej.273.s1.nabble.com/HELP-Changing-image-focus-in-between-macro-calls-tp3684655p3684657.html
Hi Daniel,
For your example the only way to solve this problem seems to be to use:
selectWindow("mri-stack.tif");
I noticed that the combination:
id = getImageID();
selectImage(id);
or
wait(1000);
does not solve the problem.
Best wishes
Kees
-----Original Message-----
From: ImageJ Interest Group [mailto:
[hidden email]] On Behalf Of Daniel Kalthoff
Sent: 09 May 2011 14:14
To:
[hidden email]
Subject: HELP - Changing image focus in between macro calls
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