Login  Register

Re: Edit>Selection>Line to Area produces change in area of freehand line?

Posted by vischer on Jul 16, 2010; 2:33pm
URL: http://imagej.273.s1.nabble.com/Edit-Selection-Line-to-Area-produces-change-in-area-of-freehand-line-tp3687606p3687608.html

When working with larger linewidths:
It appears that if the line is of type polyline, round caps are
added when choosing "Line to Area" (even if it only consists of a single segment).

The added area corresponds to :
        linewidth^2 * PI/4
(i.e. a circle with dia= linewidth).
The test macro below creates two identical lines, but in the second case,
Area jumps from 5000 to 6926.

Norbert




run("Clear Results");
run("Line Width...", "line=50");

makeLine(100, 100, 200, 100);
run("Measure");//Area = 5000

wait(1000);
run("Line to Area");
run("Measure");//Area = 5000

wait(1000);
makeSelection("polyLine", newArray(100, 200), newArray(100, 100));
run("Measure");//Area = 5000

wait(1000);
run("Line to Area");
run("Measure");//Area = 6926