reduceBaseline-methods {Cardinal} | R Documentation

## Reduce the Baseline for an Imaging Dataset

### Description

Apply baseline reduction to a mass spectrometry imaging dataset.

### Usage

    ## S4 method for signature 'MSImageSet'
    reduceBaseline(object, method = "median",
        ...,
        pixel = pixels(object),
        plot = FALSE)

    ## Median baseline reduction
    reduceBaseline.median(x, blocks=500, fun=min, spar=1, ...)

### Arguments

`object` | An object of class `MSImageSet`.
`method` | The baseline reduction method to use.
`pixel` | The pixels to baseline subtract. If less than the extent of the dataset, this will result in a subset of the data being processed.
`plot` | Plot the mass spectrum for each pixel while it is being processed?
`...` | Additional arguments passed to the baseline reduction method.
`x` | The mass spectrum to be baseline subtracted.
`blocks` | The number of intervals to break the mass spectrum into in order to choose minima or medians from which to interpolate the baseline.
`fun` | Function used to determine the points from which the baseline will be interpolated.
`spar` | Smoothing parameter for the spline smoothing applied to the spectrum in order to decide the cutoffs for throwing away baseline references that might occur inside peaks.

### Details

Baseline reduction is usually performed using the provided functions, but a user-created function can also be passed to `method`. In this case it should take the following arguments:

- `x`: A `numeric` vector of intensities.

- `...`: Additional arguments.

A user-created function should return a `numeric` vector of the same length. with the baseline-subtracted intensities.

Internally, `pixelApply` is used to apply the baseline reduction. See its documentation page for more details on additional objects available to the environment installed to the baseline reduction function.

### Value

An object of class `MSImageSet` with the baseline-subtracted spectra.

### Author(s)

Kylie A. Bemis

### See Also

`MSImageSet`, `pixelApply`

### Examples

    data <- generateImage(as="MSImageSet")
    reduceBaseline(data, method="median", plot=interactive())

[Package Cardinal version 1.12.1 Index]