Login  Register

how does line to area work?

Posted by Jeff Spector-2 on Dec 17, 2019; 3:57pm
URL: http://imagej.273.s1.nabble.com/how-does-line-to-area-work-tp5022788.html

Greetings,
 I am trying to convert segmented lines with a line width of 5 from line to
area. When I use the line to area command, the area is not correct. See
example macro here :


//setTool("polyline");
makeLine(242,91,242,96);
roiManager("Add");
run("Measure");
roiManager("Select", 0);
run("Line to Area");
roiManager("Add");
roiManager("Select", 1);
run("Measure");
//setTool("line");
makeLine(242, 90, 242, 95);
roiManager("Add");
roiManager("Select", 2);
run("Measure");
run("Line to Area");
roiManager("Add");
roiManager("Select", 3);
run("Measure");

For the segmented line I get Area 30 ( the line should by 5 x 5 = 25 pixels
For the segmented line to area I get Area 46
For the straight line tool I get area 25 in both cases.

It appears that line to area acts funny on segmented lines. I've also
noticed that the segmented line always starts in the upper lefthand corner
of a pixel where as the straight line tool will start where I click within
a pixel. Is there some kind of interpolation going on? I can work with
straight lines for now but just wanted to bring this up in case there are
people using line to area on segmented lines and weren't aware of this
behavior. Can someone please let me know why this is happening?

Thanks,
-Jeff

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html