clipper: Clipper

Description Usage Arguments Value See Also Examples

View source: R/clipper.R

Description

A function to clip a SAM or Smooth object object (also a matrix, but I recommed this only for debugging). ALthough you can use this function in a 'step by step' process it is otherwise directly called by summary_sam which uses a clipmask object (returned by toClip as a clipping mask.

Usage

1
clipper(tarjet, centre = c(128, 128), rad = 120, slice = 1)

Arguments

tarjet

object of class SAM or Smooth (or matrix) to clip.

centre

The coordinates of the polygon centre (x,y).

rad

The circle radius.

slice

which slice of the SAM or Smooth object should be clipped? (only one!)

Value

The tarjet object clipped as matrix (and S3 clipper -not for human consumption).

See Also

toClip codeclipmask summary_sam.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
x <- tile_read(base::system.file("extdata/tile.bsp", package = "uFTIR"))
x <- tile_base_corr(x)
x <- wavealign(x, primpke)
x <- tile_sam(x)
x <- smooth_sam(x, as.integer(length(primpke@clusternames)), window = 3, 1)

clip <- toClip(8,20,c(10,10))
plot(x)
polygon(clip@xycoords)

x <- clipper(x, clip@centre, clip@rad, 1)

uFTIR documentation built on Oct. 25, 2021, 9:08 a.m.