run("draw") slower than drawing lines with drawLine
Posted by Emmanuel Levy on Aug 10, 2011; 3:55am
URL: http://imagej.273.s1.nabble.com/run-draw-slower-than-drawing-lines-with-drawLine-tp3683528.html
Hi,
I'm drawing a contour line around identified objects for quality
control. Given that I have a lot of objects, I'm trying to improve the
"drawing speed".
I tried 3 options:
1.
roiManager("Select", object);
run("Draw");
2.
roiManager("Select", object);
run("Area to Line");
run("Clear", "slice");
3.
roiManager("Select", object);
getSelectionCoordinates(xCoordinates, yCoordinates);
for (pix =0; pix < xCoordinates.length-1; pix++){
drawLine(xCoordinates[pix], yCoordinates[pix] ,xCoordinates[pix+1],
yCoordinates[pix+1] );
}
Option 3 is the fastest of all! (this let me wonder if the method
"draw" couldn't be improved?). Actually, this is quite a stupid
question but ... where should I look for code of "built-in" functions?
Thanks!
Emmanuel