qPLMClust: Spatial Clustering of Axial Orientation Data from qPLM

View source: R/qPLMClust.R

qPLMClustR Documentation

Spatial Clustering of Axial Orientation Data from qPLM

Description

qPLMClust produces a hierarchical set of groups that describe contiguous regions of a specimen with slow axis orientations that are more similar to each other than they are to neighboring regions.

Usage

qPLMClust(
  qPLM,
  cortical = FALSE,
  grainSize = 20,
  cutoff = 20,
  criterion = "theta",
  thresHold = 0.8,
  multi = TRUE
)

Arguments

qPLM

A qPLMarr or qPLMtab object.

cortical

Set to TRUE to automatically "unwrap" cortical bone cross sections around the centroid (i.e., set a tangential reference frame for in-plane orientation; see centroidCorr). Default is FALSE.

grainSize

Starting subsample dimensions in pixels. qPLM.clust will cluster square blocks of grainSize x grainSize pixels based on the angular central Gaussian distribution of their orientations. Default is a 20 by 20 pixel area (400 pixels), which allows a balance between discriminating smaller tissue features and providing enough individual pixels for a tight estimate of distribution.

cutoff

Minimum number of measured pixels present for a block to be processed. If a grainSize x grainSize block has fewer than cutoff measured pixels, it will be dropped. Intended to guard against odd block parameters from edge effects.

criterion

default is "theta," which defines clusters based on the magnitude of the minor axis eigenvalue (low - high values reveal more or less anisotropy, respectively) and the out-of-plane angles of the major and second axes of the angular central Gaussian distribution of collagen fiber orientation per grainSize x grainSize) block. This is roughly equivalent to clustering by brightness in circularly polarized light microscopy, with some added nuance.

Other available criteria:

"anisotropy", which defines clusters based solely on the eigenvalue magnitude of all three axes, and discards information on the orientation of the axes (experimental, may be useful for defining kinked/bent tendons or ligaments vs. surrounding tissue);

"custom", which allows users to select from the nine independent angular central Gaussian descriptors:

[1:3]

1st - 3rd axis eigenvalues;

[4:6]

1st axis Euclidean coordinates (x,y,z);

[7:9]

2nd axis Euclidean coordinates (x,y,z).

To specify which descriptors to use, the user must create a list object named "customCrit" that contains the descriptor numbers as listed above. qPLMClust will search the local environment for customCrit.

thresHold

qPLMClust will plot all groupings that have a similarity score of less than this variable. Useful for getting back to major tissue differences when there are artifacts in the image that drown out biologically relevant tissue dissimilarity.

multi

For troubleshooting. Estimating the angular central Gaussian distribution in parallel using foreach is much faster, but any errors arising from the internal call to angGaussSumm (singular matrices, etc.) are masked from the user this way. Setting multi to FALSE reverts to a nested for loop to highlight errors.

Details

qPLMClust uses iterative agglomerative clustering (Lance & Williams 1966; 1967) based on Euclidean distances between parameters of the angular central Gaussian distribution (Tyler 1987), constrained by spatial neighborhood (Legendre & Legendre 2012:839 - 844).

This function provides an automated means of selecting areas of tissue that have a distinct "fabric" (e.g., mid-cortical vs. endosteal bone in long bone cross-section). It was specifically written to avoid the multiple arbitrary judgement calls that must be made when trying to sub-sample a bone cross-section using several small ROIs to stand in for a "class" of tissue.

The comparison is blind to the biological significance of orientation differences–it is up to the user to select an appropriate hierarchical level of comparison.

Value

Returns a qPLMclust object, which is a list with four components:

  1. $qPLMtab: the pixel-by-pixel orientation data in qPLMtab format.

  2. $GaussRaster: a RasterBrick representation of the angular central Gaussian distribution parameters per block.

  3. $groupMatrix: a matrix with rows that represent processed pixel blocks, and columns that represent successively more inclusive agglomerative spatial clusters. The cells in each column give the group membership for each block at that level, and the contents of the bottom cell in each column give the similarity value for that agglomerative step.

  4. $groupRaster: a RasterBrick representation of the clusters that merge at lower similarity values than the value specified by the thresHold variable. pullCluster calls on this component to let the user page through the high-level clusters and select a level that reflects their specific biological question (e.g., clusters that separate an area of tendon insertion relative to surrounding periosteal bone).

References

Lance, G.N., and Williams, W.T., 1966. A generalized sorting strategy for computer classifications. Nature 212:218.

Lance, G.N., and Williams, W.T., 1967. A general theory of classificatory sorting strategies. I. Hierachical systems. Computer J 9:373 - 380.

Legendre, P., and Legendre, L., 2012. Numerical Ecology. Elsevier.

Tyler, D.E., 1987. Statistical analysis for the angular central Gaussian distribution on the sphere. Biometrika, 74(3): 579 - 589.

See Also

Other qPLM Analysis Functions: angGaussSumm(), centroidCorr(), pullCluster(), pullROI(), pullqPLMSample(), qPLMTabulate()

Examples

#oldwd<-getwd()
#setwd(system.file("extdata", package = "microTransit"))
#load("testqPLMarr.R")
#load("testqPLMtab.R")
#setwd(oldwd)

testqPLMclust_arr<-qPLMClust(testqPLMarr)
testqPLMclust_tab<-qPLMClust(testqPLMtab)



TobinH/microTransit documentation built on Jan. 19, 2024, 5:21 a.m.