Login  Register

Re: Draw circles using ultimate point data

Posted by jomwalke on Feb 28, 2014; 12:33am
URL: http://imagej.273.s1.nabble.com/Draw-circles-using-ultimate-point-data-tp5006065p5006707.html

jmcginnity wrote
"draw circles from the Ultimate Point data (Process-Binary-Ultimate Points) of this image"
Here is a macro I've been working on to do this.

W = getWidth();
H = getHeight();
for (i=0; i<=H+1; i++) {
        for(j=0; j<=W+1; j++) {
        r = getPixel(i,j);
        if (r==0) moveTo(i+1, j+1);
        else makeOval(i-r, j-r, r*2, r*2);
        Overlay.addSelection
        }
}