addMask: Plot or add a mask

Description Usage Arguments Examples

View source: R/addMask.R

Description

This function plots or adds a mask raster on the default graphics.

Usage

1
addMask(mask, add = TRUE, col = "black")

Arguments

mask

a binary or logical matrix, describing the mask (0:black for selected pixels, 1:white for not selected pixels)

add

a logical variable, whether to add the mask to an existing plot

col

a character string, color value of the plotted mask

Examples

1
2
3
4
5
6
7
8
9
#read a mask file in TIFF format
m <- tiff::readTIFF(system.file(package = 'xROI', 'dukehw-mask.tif'))
str(m)

#plot the mask in black color
addMask(m, add = FALSE)

#add the same mask in the red color to the existing plot
addMask(m, add = TRUE, col = 'red')

xROI documentation built on June 2, 2021, 9:07 a.m.