maskOutline: Intersects a RasterStack with an outline. Everything outside...

View source: R/maskOutline.R

maskOutlineR Documentation

Intersects a RasterStack with an outline. Everything outside of the outline will be removed from the raster.

Description

Intersects a RasterStack with an outline. Everything outside of the outline will be removed from the raster.

Usage

maskOutline(
  RasterStack,
  outline,
  refShape,
  landList = NULL,
  adjustCoords = FALSE,
  cartoonID = NULL,
  IDlist = NULL,
  crop = c(0, 0, 0, 0),
  flipRaster = NULL,
  flipOutline = NULL,
  imageList = NULL,
  maskColor = 0,
  inverse = FALSE
)

Arguments

RasterStack

RasterStack to be masked.

outline

xy coordinates that define outline.

refShape

This can be 'target' in case the reference shape is a single sample (for registration analysis) or 'mean' if the images were transformed to a mean shape (only for meanshape when using landmark transformation)

landList

Landmark list to be given when type = 'mean'.

adjustCoords

Adjust landmark coordinates in case they are reversed compared to pixel coordinates (default = FALSE).

cartoonID

ID of the sample for which the cartoon was drawn. Only has to be given when refShape is 'mean'.

IDlist

List of sample IDs should be specified when refShape is 'mean'.

crop

Vector c(xmin, xmax, ymin, ymax) that specifies the pixel coordinates to crop the original image used in landmark or registration analysis.

flipRaster

Whether to flip raster along xy axis (in case there is an inconsistency between raster and outline coordinates).

flipOutline

Whether to flip plot along x, y or xy axis.

imageList

List of image as obtained from makeList should be given if one wants to flip the outline or adjust landmark coordinates.

maskColor

Color the masked area gets. Set to 0 for black (default) or 255 for white.

inverse

If TRUE, areas withing the outline will be masked.

Examples


## Not run: 
data(imageList)
outline_BC0077 <- read.table(paste(system.file("extdata",  package = 'patternize'),
'/BC0077_outline.txt', sep=''), header = FALSE)

masked <- maskOutline(imageList[[1]], outline_BC0077, refShape = 'target', flipOutline = 'y')

## End(Not run)


StevenVB12/patternize documentation built on Nov. 2, 2023, 8:01 p.m.