This function sets a specified variable from the metadata of the given object to be used if identifyTissueOutline() does not produce acceptable results.

useVarForTissueOutline(
  object,
  var_name,
  concavity = 2,
  min_obs = nObs(object) * 0.05
)

Arguments

object

An object of class SPATA2 or, in case of S4 generics, objects of classes for which a method has been defined.

var_name

A character string specifying the name of the variable in the metadata to be used for the tissue outline.

concavity

Numeric value. Given to argument concavity of concaveman::concaveman(). Determines the relative measure of concavity. 1 results in a relatively detailed shape, Infinity results in a convex hull. You can use values lower than 1, but they can produce pretty crazy shapes.

min_obs

Numeric value. The minimal number of observations a group must have to be considered a tissue section. Defaults to 5% of the total number of observations. Must be higher than 3.

Value

The updated input object, containing the added, removed or computed results.

See also

createSpatialSegmentation() to create the outline manually, then use the created spatial segmentation variable as input for var_name.