The filters we used to support our samples under the uFTIR microscope are round. This means that a cube might not be the best representation of our data, as they have noisy borders that might be missinterpreted by the program. Then, I implemented a clipper
function to clip objects of class SAM
or Smooth
(even an S3 matrix) before summarizing them. Although this can be done step by step, you can also create a clip-mask for the summary_sam
function to clip them for you. To crate this clip-mask, you can call the function toClip
which returns an object of this class.
The class has yet another use. Since the samples are placed under the microscope by hand, the cropping area is not always the same and (usually) it has to be adjusted. To have a visual aid, you can use the function toClip
, to then plot a SAM
or Smooth
and overlay the croppling circle by calling polygon
and the xycoords slot of an object of this class (returned by toClip
). Using that process you can test manually different center points and radius for the clipping circle.
An S4 object of class "clipmask" to be used (internally) by the clipper
function.
xycoords
polygon (circle) coodinates to plot. matrix with two columns (x,y).
rad
cicle radius. integer.
centre
circle centre. Numeric vector of two elements (x,y).