Posted by
Gabriel Landini on
Dec 14, 2015; 10:24am
URL: http://imagej.273.s1.nabble.com/profile-extraction-tp5015223p5015231.html
On Monday 14 Dec 2015 09:59:08 Peter Haub wrote:
> here is a VERY simple macro that extracts some information of the edge
> profile.
> Copy it into a macro window and run :
>
> setOption("BlackBackground", false);
> run("Make Binary");
> run("Invert");
> run("Select All");
> run("Plot Profile");
>
> Maybe this is all you need.
The above is, unfortunately, not a robust method. If there are any overhangs
in the profile the will be missed with "plot profile". If you rotate the
image, the profile will be different too.
It is not clear if the chained boundary is required (maybe the analysis can
work with just the image of the boundary). But if you do, what I would do is
binarise the boundary coordinates of the material and identify a start point
and an end point. Then link (using for example 8-pixel connectivity) from the
start to the end point (and all the points in between, so this is essentially
"walking along the boundary"). Each time you step on a next unvisited pixel
you store the coordinates in an array of x and y positions. This procedure
stores them in the walking order.
Search the literature for 'Freeman chain encoding' for details on the
algorithm to do this, because the above is just a simplification.
Cheers
Gabriel
--
ImageJ mailing list:
http://imagej.nih.gov/ij/list.html