Do not display stacks when running macro

Hi there,
I’m running a macro where I open a serie of images and generate a stack.
Even although i specify setBatchMode(true); the stack command displays it on the screen.
That’s not a problem for one set of images but when I’m running sequentially 96 stacks with 120-images each makes the processing way more slow.
Is there any possibility to do not display the stack?
Thank you very much

Stacks are not supposed to be displayed in macros running in batch mode. It would be helpful to know what exactly is “the stack command” and also to have a small macro that reproduces the problem.

Hi Wayne, thanks for your answer. I’m sorry I have a strong biological background and I’m starting in the coding world so I might not be explaining properly.
Long story short, I have a 96 well plate from which I take one picture every hour of every single well (actually it takes two images per well). All data are stored in the same folder. I run a “temporal color code” plugin that overlaps images from the same well along time, assigning to each one a different colour. But it only does that from those contained in the same well and position within the well. The macro works perfectly.
My problem is the way that I’m using for opening the images, because it displays them, even when I specify to run in batchMode.
What I’m using is this:
run(“Image Sequence…”, “open=[”+dir_input+"] file="+well+" sort");
But I enclose the whole macro so people can make an idea of the problem:

//Initialise
run(“Close All”);
setBatchMode(true);
//Get user to choose the directory that the images are contained within and where to put the resultant ones.
dir_input=getDirectory(“Choose the directory containing your images.”);
dir_output=getDirectory(“Choose the directory for processing output.”);
filelist=getFileList(dir_input);
//choose the first and last image to want to add to the stack.By default it will use numbers 1 and 48
first_image=getNumber(“Choose the the first image number for the stack”, 1);
last_image=getNumber(“Choose the the last image number for the stack”, 48);

//assign a name to the function that we want, including the arguments into brackets ()
makeStack(dir_input, dir_output, first_image, last_image);
//THIS IS THE MAIN FUNCTION THAT WILL BE APPLIED ALL THE TIME
function makeStack(dir_input, dir_output, first_image, last_image){

for(row=1;row<=8; row=row+1){
for(col=1; col<=12; col=col+1){
for(pos=1; pos<=3; pos=pos+1){
//well will be a string, not a number (ie B2, or H12)
//print(charRow); well=d2s(row,0)+d2s(col,0);
charRow=fromCharCode(row+64);
well=""+charRow+d2s(col,0)+""+(pos);
//test that file exists
exists = false;
for(fileIndex=0; fileIndex<filelist.length; fileIndex++){
if((indexOf(filelist[fileIndex],well))>=0){
exists = true;
}
}
if(exists){
run(“Image Sequence…”, “open=[”+dir_input+"] file="+well+" sort");
setSlice(1);
name= getInfo(“slice.label”); // this gives me the name of the title, that is a label in the stack
index = (lastIndexOf(name,""));
pathTemp= substring(name,0,index);
//print(pathTemp);
index=(lastIndexOf(pathTemp,"
"));
//print(index);
nametosave= substring(name,0,index); // this gives us the file name without the timepoints but with the well and plane position (1 or 2)
//print(nametosave);
run(“Slice Keeper”, “first=”+first_image+" last="+last_image+" increment=2");
run(“Temporal-Color Code”, “lut=[Rainbow RGB] start=1 end=24”);
selectWindow(“MAX_colored”);
rename(“rainbow”);
selectImage(“rainbow”);
outputFilename = dir_output+nametosave+“stack”+first_image+“to”+last_image;
saveAs(“Tiff”, outputFilename);
run(“Close All”);
}
} //For position open {
} // for column
} // for row
} // for function

This is a bug in Fiji’s Image>Hyperstacks>Temporal-Color Code command, which is implemented by a macro. You can work around the bug by downloading the version of the macro at

http://wsr.imagej.net/download/Macros/Time-Lapse_Color_Coder.ijm

into the Fiji.app/plugins/Macros folder and changing

run(“Temporal-Color Code”, …

to

run(“Time-Lapse Color Coder”, …

in your macro.

I think that will solve the problem
I will work on this right now
Thank you very much