Re: batching imageCalculator - [ i ] unexpected
Posted by
gianpaolo rando on
URL: http://imagej.273.s1.nabble.com/batching-imageCalculator-please-NOT-spam-tp3702275p3702277.html
Thank you, seems to be what I need
but...
running the macro I expect (1A-1B); (2A-2B); (3A-3B),
and I obtain: (1A-3B); (2A-1B); (3A-2B)
it means that the first image "A" is well-processed, but there is a index-misunderstanding concerning the image "B". I've tried to checking the [i]-stuff, but my java is poor...
Also the macro written by Greg Joss give the same results.
(I've checked my images: no accidental exchange)
Brainstorming please!
Gianpaolo Rando
----- Messaggio Originale -----
> You can try something like this macro:
>
> -------Snip-----------
>
> dirA = getDirectory("Choose source A Directory ");
> listA = getFileList(dirA);
> //print(""+dirA+listA[i]);
> dirB = getDirectory("Choose source B Directory ");
> listB = getFileList(dirB);
> //print(""+dirB+listB[i]);
> count=1;
> for (i=0; i<listA.length; i++) {
> open(""+dirA+listA[i]);
> rename("A");
> open(""+dirB+listB[i]);
> rename("B");
> imageCalculator("Subtract create", "A","B");
> saveAs("Tiff", "/home/kriss/Desktop/C/Result"+count+".tif");
> count++;
> close();
> close();
> close();
> }
>
> -------Snap-----------
> Christophe CHAMOT
> -----------------------------------------------------------------
> gianpaolo rando a écrit :
> I've two directories:
> both containing a lot of image files with the same title (1,
> 2, 3).
> >> I need to write a macro that subtract image B/1 to A/1, B/2
> to
> >> A/2, B/3 to A/3...
> >>
> >> some suggestions?
> >>
> >> Gianpaolo Rando
> >> University of Milan