Learn R Programming

xROI (version 0.9.20)

rasterizeROI: Rasterize ROI Polygons

Description

This function convert point-based polygons to raster format

Usage

rasterizeROI(pnts, imgSize)

Arguments

pnts

a numeric matrix. a two column matrix of points as relative x and y values (0 to 1)

imgSize

a numeric vector, size of the final raster

Value

a binary matrix. matrix of the mask file.

Examples

Run this code
# NOT RUN {
pnts <- matrix(c(0.1, 0.2,
                 0.1, 0.4,
                 0.5, 0.4,
                 0.5, 0.2),
                 4, 2, byrow= TRUE)
imgSize <- c(300, 400)
m <- rasterizeROI(pnts, imgSize)
xROI::addMask(m, add = FALSE)

# }

Run the code above in your browser using DataLab