RE: batch processing macro problem.

Posted by jacob goodwin on
URL: http://imagej.273.s1.nabble.com/batch-processing-macro-problem-tp5011621p5011758.html

Hi Christine,

Thanks again for you help.  I ran this through the macro menu on my PC and no luck, but on the Mac using Fiji it is almost there.  It now no longer asks me to select input and output files and gives me the correct number of montages.  but I am still having the issue where it puts the dapi from the previous set into the green channel of the next montage.

It does the first montage fine, but it seems as though when it selects the next set of 4 images it collects and starts with the dapi,  to explain further if I have three sets of 4 images and i will label them from 1-12 the first round picks up 1-4, the second round picks up 4-7, the third round picks up 8-11

I guess that the issue lies somewhere in this part of the macro. 

setBatchMode(true);            
    for (f=0; f<list.length; f++) {
        path = dir+list[f];              

end = endsWith(path, "8.tif"); {
 if (end==true)  {
    run("Image Sequence...", "open=path number=4 starting=f sort");
    t=getInfo("slice.label");
//t=getTitle();
  s=lastIndexOf(t, 'A');
  t=substring(t, 0, s);
  t=replace(t," ","_");
t2= t +' montage.tif';
print(t);

But I really don't know where.  I was having a look at another image to stack macro for three channels, and they included  this

 n = list.length;
      if ((n%3)!=0)
         exit("The number of files must be a multiple of 3"); 

which I guess tells the macro that the images are in threes, could this be applied to your macro but incorporate 4 instead?  The macro, at least on my computer, cannot seem to pick up the right images for processing.

Thanks again for all of your help,

Jacob