Login  Register

Re: how does line to area work?

Posted by Wayne Rasband-2 on Dec 27, 2019; 7:07pm
URL: http://imagej.273.s1.nabble.com/how-does-line-to-area-work-tp5022788p5022810.html

> On Dec 17, 2019, at 10:57 AM, Jeff Spector <[hidden email]> wrote:
>
> 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.

This bug should be fixed in the latest ImageJ daily build (1.52t15), thanks to new line to area conversion code from Michael Schmid.

-wayne


> 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

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