Skip to contents

Add Spatial Shrunked Centroid (ssc) results from a non-intensity based Cardinal Object into the pixelData slot of a provided Cardinal Object containing intensity values for each m/z (e.g. MSImagingExperiment). This function is additional functionality that can only be run on Cardinal Objects ONLY.

Usage

add_ssc_annotation(data, data_ssc, resolution = 25)

Arguments

data

A Cardinal Object containing the raw/binned m/z count data.

data_ssc

A Cardinal Object containing the ssc segmentation results. Note: Cardinal's spatialShrunkenCentroids() must be run to generate this object.

resolution

An integer defining the ssc segmentation resolution to add to the raw Cardinal object (default = 25).

Value

A Cardinal Object containing the raw m/z counts and the relative ssc segmentation annotations per pixel.

Examples

# ssc_data <- Cardinal::spatialShrunkenCentroids(CardinalObj, ...)
# new_CardinalObj <- add_ssc_annotation(CardinalObj, ssc_data, resolution =25)