rasterizeROI: Rasterize ROI Polygons

Description Usage Arguments Value Examples

View source: R/rasterizeROI.R

Description

This function convert point-based polygons to raster format

Usage

1
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

1
2
3
4
5
6
7
8
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)

bnasr/xROI documentation built on June 7, 2021, 7:56 a.m.