DrawROI: Draw Region of Interest

Description Usage Arguments Details Value Author(s)

View source: R/DrawROI.R

Description

This function allows to draw one (or more) region(s) of interest (ROI) on a jpeg image.

Usage

1
2
DrawROI(path_img_ref, path_ROIs, nroi = 1, 
	roi.names, file.type='.jpg')

Arguments

path_img_ref

Path in your folder for the reference image

path_ROIs

Path where to store image with ROI and ROI coordinates.

nroi

The number of ROIs you want to draw.

roi.names

A character vector with ROI names.

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

The function allows to draw one or more ROIs on an image or to load saved ROIs. The function uses locator to locate points, closes the polygon and stores an RData with coordinates. The use of locator is restricted to only some graphic devices. Tne function attempts to open an X11 device. In Mac OS the poligon is closed by typing ESC key. See locator for details.

Value

A list containing the following:

pixels.in.roi

Data for pixels contained in the ROI

vertices

Vertices of the ROI

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)

Edoardo Cremonese <e.cremonese@arpa.vda.it>


phenopix documentation built on May 2, 2019, 4:50 p.m.