Transforms area in SI units to pixel based on the current resolution of the image in the SPATA2 object.

transform_area_si_to_pixel(input, object, round = FALSE)

transform_area_si_to_pixels(input, object, round = FALSE, as_numeric = TRUE)

Arguments

input

Area in SI units. See details for more information.

object

A valid SPATA2 object or NULL. If specified the distance scaling is adjusted to the current resolution of the image inside the object. If NULL, image_dims and method must be specified.

round

Numeric value or FALSE. If numeric, given to digits of base::round(). Rounds transformed values before they are returned.

as_numeric

Logical value. If TRUE, forces the output to be numeric. This means that the unit is not not suffixed.

Value

Transformed input. Vector of the same length as input. Function transform_area_si_to_pixel() always returns a single numeric value. Function transform_si_to_pixels() returns a numeric vector by default. If as_numeric

is FALSE, the output is a string suffixed with px.