Learn R Programming

xROI (version 0.1.1)

addMask: Plot or add a mask

Description

This function plot or add a mask raster on the graphics.

Usage

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

Arguments

mask

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

add

whether to add the mask to and existing plot

col

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 red color to the existing plot
addMask(m, add = TRUE, col = 'red')

# }

Run the code above in your browser using DataLab