|
Dear list,
I´m new to the list but write ImageJ macros for a couple of years.
Sometimes I encountered different behaviour of macro code as soon as the
batchMode gets activated. I used to rewrite the code and dodge the
problem but this time I made the effort to extract the few lines of code
that behave different. The macro below very simply opens the images in a
dir and concatenates them to a single stack, named after the first
image. It should work with any directory exclusively containing images
of same type and size.
In BatchMode the macro isn`t working correctly. Only some of the images
are contained in the resulting stack. Running the macro in debug mode I
can observe a rising number of images that exist but are not visible
(due to the BatchMode). Obviously they are not integrated in the stack.
macro "demonstrates different behaviour in batchMode"{
//setBatchMode(true);
dirin=getDirectory("Choose location of the stack images");
list=getFileList(dirin);
f=0;
for(m=0;m<list.length;m++){
f++;
open(dirin+list[m]);
if(f==1) name=list[m];
else run("Concatenate...", "stack1="+name+" stack2="+list[m]+"
title="+name);
}
//setBatchMode(false);
}
Is it known that some commands show a different behaviour with BatchMode
"true" or "false"?
I couldn`t find any general comments or explanations in the list archives.
Is it a bug or is it me getting something wrong ?
I´m not looking for a work around, I can make up one myself, but would
like to be able to circumvent this problem in the future.
Many thanks for any comments or explanations.
Best Regards
Eik
|