Calculate the binary reference image using k-means clustering with multi-cluster merging. K-means is run on the first `npcs` principal components to speed up the calculations.
refImageBinaryKmeansMulti(
dataset,
npcs = 10,
mzQuery = numeric(),
mzTolerance = Inf,
useFullMZ = TRUE,
numClusters = 4,
kernelSize = 5,
cores = 1,
verbose = TRUE
)
ms.image-class object with binary intensities.
msi.dataset-class object. See msiDataset.
int (default = 10). Number of principal components to calculate.
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 overrides the argument useFullMZ
.
numeric (default = Inf). Tolerance in PPM to match the
mzQueryRef
values in the m/z vector.
logical (default = TRUE). Whether all the peaks should be used to calculate the reference image.
numeric (default = 4). Number of clusters.
4-D numeric array or numeric (default = 5). Each element of the 4-D array represents the size of the corners square kernels used to determine the off-tissue clusters. The element order is clockwise: top-left, top-right, bottom-left, bottom-right. If negative, the corresponding corner is skipped. If only a single value is passed, the same kernel size is used for the 4 corners.
numeric (default = 1). Number of CPU cores for parallel k-means.
boolean (default = TRUE). Additional output.