Learn R Programming

xROI (version 0.9.20)

addMask: Plot or add a mask

Description

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

Usage

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

Run this code
# NOT RUN {
#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')

# }

Run the code above in your browser using DataLab