getSpatAnnCenter() computes the x- and y- coordinates of the center of the outer border, returns a numeric vector of length two. getSpatAnnCenters() computes the center of the outer and every inner border and returns a list of numeric vectors of length two.

getSpatAnnCenter(object, ...)

# S4 method for class 'SPATA2'
getSpatAnnCenter(object, id)

# S4 method for class 'SpatialData'
getSpatAnnCenter(object, id)

# S4 method for class 'SpatialAnnotation'
getSpatAnnCenter(object)

getSpatAnnCenters(object, ...)

# S4 method for class 'SPATA2'
getSpatAnnCenters(object, id, outer = TRUE, inner = TRUE)

# S4 method for class 'SpatialData'
getSpatAnnCenters(object, id, outer = TRUE, inner = TRUE)

# S4 method for class 'SpatialAnnotation'
getSpatAnnCenters(object, outer = TRUE, inner = TRUE)

Arguments

object

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

...

Used to absorb deprecated arguments or functions.

id

Character value specifying the ID of the spatial annotation of interest. If there is only one spatial annotation in the object, the function will default to using it. However, if there are multiple annotations, this argument must be explicitly specified to identify the target annotation.

outer

Logical value. Only applies if an image annotation contains a secondary image annotation within its own area. If FALSE, the outer border of the image annotation is not included in the output.

inner

Logical value. Only applies if an image annotation contains a secondary image annotation within its own area. If FALSE, the inner borders of the image annotation are not included in the output.

Value

Numeric vector of length two or a list of these. Values are named x and y.

Examples


library(SPATA2)

object <- loadExampleObject("LMU_MCI")

plotSpatialAnnotations(object, unit = "px")

getSpatAnnCenter(object, id = "inj1")