This function is an attempt to approximate the technique described first in Micheas et al. (2007) and as modified in Lack et al. (2010). It will only find the centroids, rays extending from them to the boundaries, and the boundary points. Use distill
to convert this output into an object readable by, for example, procGPA
from package shapes.First, identified features (which may be identified by any feature identification function that yields an object of class features) are taken, the centroid is found (the centroid is found via centroid.owin
so that the x- and y- coordinates are fliped from what you might expect) and very long line segments are found radiating out in both directions from the center. They are then clipped by where they cross the boundaries of the features.
The spatstat package is used heavily by this function. In particular, the function as.polygonal
is applied to the owin
objects (possible after first calling simplify.owin
). Line segments are created using the feature centroids, as found by centroid.owin
, and the user-supplied angles, along with a very long length (equal to the domain size). Boundary crossings are found using crossing.psp
, and new line segment patterns are created using the centroids and boundary crossing information (extra points along line segments are subsequently removed through a painstaking process, and as.psp
is called again, and any missing line segments are subsequently accounted for, for later calculations). Additionally, lengths of line segments are found via lengths.psp
. Angles must also be re-determined and corresponded to the originally passed angles. Therefore, it is necessary to round the angles to 6 digits, or equal angles may not be considered equal, which will cause problems.
The hiw
function merely does the above step, as well as finds the lengths of the resulting line segments. For non-convex objects, the longest line segment is returned, and if the boundary crossings do not lie on opposite sides of the centroid, then the negative of the shortest segment is returned for that particular value. Also returned are the mean, min and maximum intensities for each feature, as well as the final angles returned. It is possible to have missing values for some of these components.
The summary
function computes SSloc, SSavg, SSmin, and SSmax between each pair of features between fields. distill
may be used to create an object that can be further analyzed (for shape) using the shapes package.
While any feature identification function may be used, it is recommended to throw out small sized features as the results may be misleading (e.g., comparisons between features consisting of single points, etc.).