ROIs Make band / Time consuming

Dear All,

I´m trying to determine if particles are surrounden of pixel values 0 or 255. I ahve two mask 1- coresponding at “Matrix” 2- Particles or “pores”

my Macro containing this:

nr=roiManager(“count”); this correspond to an anterior step: count particles and add to RM

for (i = 0; i < nr; i++) {

** roiManager(“select”, i);**
** run(“Make Band…”, “band=2”);**
** roiManager(“Update”);**

These comands works but when particles are thousands or more the step “create band” is really slow. Just this step increase quantification time infinitely…

Any idea how to solve it or depend only in pc performance?
Many Thanks!!!

Happy Quarantine!!!

Try running your macro in batch mode. This test macro runs 7 times faster in batch mode:

  t0 = getTime;
  run("Blobs (25K)");
  run("Analyze Particles...", "clear add");
  for (i=0; i < nr; i++) {
     roiManager("select", i);
     run("Make Band...", "band=2");
  print("time="+(getTime-t0)+" ms");
1 Like

Many thanks!!! I will try