Re: HELP - Changing image focus in between macro calls
Posted by
Albert Cardona-2 on
May 09, 2011; 2:18pm
URL: http://imagej.273.s1.nabble.com/HELP-Changing-image-focus-in-between-macro-calls-tp3684655p3684658.html
2011/5/9 Daniel Kalthoff <
[hidden email]>:
> 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!
You could do it in python, so that you always know which image you are
manipulating:
cochlea = IJ.openImage("
http://imagej.nih.gov/ij/images/bat-cochlea-volume.zip")
IJ.run(cochlea, "Size...", "width=100 height=121 depth=20 constrain
average interpolation=Bilinear")
mri = IJ.openImage("
http://imagej.nih.gov/ij/images/mri-stack.zip")
IJ.run(mri, "Size...", "width=100 height=121 depth=20 constrain
average interpolation=Bilinear")
See examples in python:
http://www.ini.uzh.ch/~acardona/fiji-tutorial/http://pacific.mpi-cbg.de/wiki/index.php/Jython_ScriptingAlbert
--
http://albert.rierol.nethttp://www.ini.uzh.ch/~acardona/