Visual aid to find the right center and radius for the
clipper function. It does not clip, but return an usable (plotable) object.
Since the samples are placed under the uFTIR Microscope by hand, the cropping area to pass to
clipper is not always the same and (usually) it has to be adjusted. To have a visual aid, you can use this function. It returns an S4 object of class
clipmask which can be over-plotted on top of a
Smooth object by calling
polygon and using the xycoords slot of the returned object. Using that process you can test manually different center points and radius for the clipping circle.
The circle radius.
How many segments should the resulting polygon have? (because it is not a circle, 20 is ok).
The coordinates of the polygon centre (x,y).
An object of class
1 2 3 4 5 6 7 8 9 10 11 12
toClip(1, 5, c(0,0)) 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)) polygon(clip@xycoords) x <- clipper(x, clip@centre, clip@rad, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.