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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

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

Bill Christens-Barry
Playing with the Edit>Selection>Line to Area command that is new in v1.44d, I found that measurements of an arbitrary freehand line (1 pixel in width) gave different areas before and after use of the new command:


        Label        Area  Mean       StdDev      Length
1      Two:1       394   94.932    21.618     391.638
2      Two:1       360   95.347    21.869     0

It seems curious that the area decreased upon use of the command, while the ROI outline visually increased in breadth. What's behind the changes to area that are calculated?

Bill
Reply | Threaded
Open this post in threaded view
|

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

dscho
Hi,

On Thu, 15 Jul 2010, Bill Christens-Barry wrote:

> Playing with the Edit>Selection>Line to Area command that is new in
> v1.44d, I found that measurements of an arbitrary freehand line (1 pixel
> in width) gave different areas before and after use of the new command:
>
> [...]

Note that the "area" of a 1-pixel-wide line is an ill-defined term to
begin with. I would not put too much importance on that. Much more
important is the case where you have a line with a larger width, as the
area of such an entity really has some geometrical meaning.

Hth,
Johannes
Reply | Threaded
Open this post in threaded view
|

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

vischer
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