Converts ijroi
and ijzip
objects to a list of spatstat spatial patterns.
ij2spatstat(X, window = NULL, pattern.type = NULL, unitname = NULL,
scale = 1, return.type = FALSE, convert.only = NULL)
Name of the unit of length for the resulting window(s) (see owin
).
A numeric value defining the scale of photograph in pixels / unitname
. Defaults to 1.
should the type of ROI object(s) be returned in addition to spatstat spatial patterns? Defaults to FALSE
.
a character vector specifying the strType
of ROI objects to be converted (see plot.ijroi
for possible pattern types). Pattern types not mentioned will not be converted. Works only if X
is an 'ijzip' object. Ignored otherwise.
Returns a list of spatstat patterns of approperiate type (see 'Details'). If return.type = TRUE
returns a list with two levels specifying the spatstat pattern and the ROI type.
The function converts ijroi
and ijzip
objects to spatstat spatial patterns for further calculations with the objects. By default, areal types ("rect", "oval", "ELLIPSE", "polygon") are converted to owin
objects. Line types ("line" (including "ARROW"), "freeline", "polyline", "angle", "freehand" (excluding "ELLIPSE")) are converted to psp
objects and "point" types to ppp
objects.
# NOT RUN {
file <- file.path(system.file(package = "RImageJROI"), "extdata", "ijroi", "ijzip.zip")
x <- read.ijzip(file)
ij2spatstat(x)
# }
Run the code above in your browser using DataLab