convertROI {phenopix} | R Documentation |
Convert a region of interest object from the old structure to the new (phenopix > 2.4)
Description
This function allows to convert the roi.data
stored in the roi.data.Rdata
object built with
phenopix
older than version 2.4 into the new structure better described in the details section. The
changed was needed because a new method for drawing a region of interest was conceived, which includes the
possibility to draw multiple polygons for a single ROI. The new function that does the job is
DrawMULTIROI
, which fully substitutes the old DrawROI
.
Usage
convertROI(path_img_ref, path_ROIs, file.type='.jpg')
Arguments
path_img_ref |
Path in your folder for the reference image |
path_ROIs |
Path where |
file.type |
It must match the syntax of your file extension (e.g. .jpg, .JPG, .JPEG). Multiple types are allowed by concatenation with c(). |
Details
This function allows to convert the roi.data
stored in the roi.data.Rdata
object built with
phenopix older than version 2.4 into the new structure better described in the details section. The changed
was needed because a new method for drawing a region of interest was conceived, which includes the possibility
of drawing multiple polygons for a single ROI. There is a second reason why DrawROI had to disappear: it
included C++ code from the package SDMTools which is currently orphaned. The new function that allows multiple
polygons in a single ROI is DrawMULTIROI
, which fully substitutes the old DrawROI
.
Value
A list containing the following:
mask |
A binary mask (a raster object) |
polygons |
An object of class SpatialPolygons |
Additionally, a jpeg image is returned with the ROI(s) drawn.
The same object that is returned is saved in the path specified in path_ROIs
Author(s)
Gianluca Filippa <gian.filippa@gmail.com>