getTissueArea | R Documentation |
Computes and extracts the size of the area covered by the tissue.
getTissueArea(object, unit, method = "obs", img_name = activeImage(object))
object |
An object of class |
unit |
Character value. Output unit. Must be one of |
method |
Character value. Defines the origin based on which the outline is computed. Either 'image' or 'obs'. |
img_name |
Character value. The name of the image of interest.
If |
A vector of area measures. Length is equal to the number of tissue sections.
getTissueSections()
, identifyTissueOutline()
library(SPATA2)
## Example 1 - image based
object <- example_data$object_UKF313T_diet
object <- identifyPixelContent(object)
object <- identifyTissueOutline(object, method = "image")
plotImage(object, outline = TRUE) +
ggpLayerAxesSI(object, unit = "mm")
getTissueArea(object, unit = "mm")
## Example 2 - coordinates based
object <- loadExampleObject("UKF313T")
object <- identifyTissueOutline(object, method = "obs")
plotSurface(object, color_by = "tissue_section") +
ggpLayerTissueOutline(object)
area_out <- getTissueArea(object)
print(area_out)
sum(area_out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.