binKmeans2-msi.dataset-method: Return a binary mask generated applying k-means clustering on...

binKmeans2,msi.dataset-methodR Documentation

Return a binary mask generated applying k-means clustering on peaks intensities. A finer segmentation is obtained by using a larger number of clusters than 2. The off-sample clusters are merged looking at the most frequent labels in the image corners. The lookup areas are defined by the kernel size.

Description

Return a binary mask generated applying k-means clustering on peaks intensities. A finer segmentation is obtained by using a larger number of clusters than 2. The off-sample clusters are merged looking at the most frequent labels in the image corners. The lookup areas are defined by the kernel size.

Usage

## S4 method for signature 'msi.dataset'
binKmeans2(
  object,
  mzQuery = numeric(),
  useFullMZ = TRUE,
  mzTolerance = Inf,
  numClusters = 4,
  kernelSize = c(3, 3, 3, 3),
  numCores = 1,
  verbose = TRUE
)

Arguments

object

msi.dataset-class object

mzQuery

numeric. Values of m/z used to calculate the reference image. 2 values are interpreted as interval, multiple or single values are searched in the m/z vector. It should be left unset when using useFullMZRef = TRUE.

useFullMZ

logical (default = 'TRUE“). Whether all the peaks should be used to calculate the reference image.

mzTolerance

numeric (default = Inf). Tolerance in PPM to match the mzQueryRef. values in the m/z vector. It overrides useFullMZ.

numClusters

numeric (default = 4). Number of k-means clusters.

kernelSize

4D array (default = c(3, 3, 3, 3)). Array of sizes in pixels of the corner kernels used to identify the off-sample clusters. The elements represent the size of the top-left, top-right, bottom-right and bottom-left corners. A negative value can be used to skip the corresponding corner.

numCores

(default = 1). Multi-core parallel computation of k-means. Each core corresponds to a repetition of k-means. If numCores = 1, a serial k-means with 5 repetitions is performed.

verbose

logical (default = 'TRUE“). Show additional output.

Value

ms.image-class object representing the binary mask image.

Author(s)

Paolo Inglese p.inglese14@imperial.ac.uk


SPUTNIK documentation built on Nov. 24, 2022, 5:06 p.m.