getImgAnnArea | R Documentation |
Computes the area of an image annotation in SI units of area.
getImgAnnArea(
object,
ids = NULL,
unit = "mm2",
tags = NULL,
test = "any",
as_numeric = TRUE,
verbose = NULL,
...
)
object |
An object of class |
ids |
Character vector or |
unit |
Character value. Specifies the desired unit. |
tags |
Character vector or |
test |
Character value. One of any. all, identical, not_identical and
none. Specifies how input for |
verbose |
Logical. If set to TRUE informative messages regarding the computational progress will be printed. (Warning messages will always be printed.) |
... |
Used to absorb deprecated arguments or functions. |
First, the side length of each pixel is calculated and based on that the area.
Second, the number of pixels that fall in the area given by the outer border
of the image annotation is computed with sp::point.in.polygon()
.
Third, if the image annotation contains holes the pixel that fall in these holes are removed.
Fourth, the number of remaining pixels s multiplied with the area per pixel.
Numeric vector of the same length as ids
. Named accordingly.
Contains the area of the image annotations in the unit that is specified in unit
.
The unit is attached to the output as an attribute named unit. E.g. if
unit = *mm2*
the output value has the unit mm^2.
Input for argument tags
specifies the tags of interest.
Argument test
decides about how the specified tags are used to select
the image annotations of interest. There are multiple options:
Argument test
set to 'any' or 1: To be included, an image annotation
must be tagged with at least one of the input tags.
Argument test
set to 'all' or 2: To be included, an image annotation
must be tagged with all of the input tags. Can contain tags that are not specified.
Argument test
set to 'identical' or 3: To be included, an image annotation
must be tagged with all of the input tags. Can not be tagged with anything else.
Argument test
set to not_identical or 4: To be included, an image
annotation must not be tagged with the combination of input tags.
Argument test
set to 'none' or 5: To be included, an image annotation
must not contain any of the input tags.
Note that the filtering process happens after the filtering by input for argument
ids
. You can first select a group of image annotations by naming their IDs
and then select among them via tags and test. If ids
is NULL
, you select
among all image annotations via tags and test. And if tags
is also NULL
,
the function uses all image annoations.
getImgAnnOutlineDf()
, getCCD()
, as_unit()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.