Login  Register

Re: need help, I'm frustrated

Posted by Wayne Rasband on Jul 17, 2008; 6:55pm
URL: http://imagej.273.s1.nabble.com/need-help-I-m-frustrated-tp3695559p3695564.html

 > Thank you for you reply, I tried this, it worked fine with only few
 > points. However, for one test with 20K points, it took almost
 > forever to finish. I believe it's because of "or" operation.

This macro displays 20,000 points as a point selection in just a few
seconds.

   size = 2000;
   count = 20000;
   x = newArray(count);
   y = newArray(count);
   for (i=0; i<count; i++) {
      x[i] = random*size;
      y[i] = random*size;
   }
   newImage("Test", "8-bit Black", size, size, 1);
   run("Point Tool...", "mark=0 selection=yellow");
   makeSelection("point", x, y);

-wayne