| Title: | Core utilities for mass spectrometry imaging |
|---|---|
| Description: | Low-level processing and visualization utilities for mass spectrometry imaging analysis in Cardinal. |
| Authors: | Kylie Ariel Bemis [aut, cre], Melanie Christine Foell [ctb, dtc], Dan Guo [ctb], Sai Srikanth Lakkimsetty [ctb], Ethan Rogers [ctb], Yinyue Zhu [ctb], Olga Vitek [fnd] |
| Maintainer: | Kylie Ariel Bemis <[email protected]> |
| License: | Artistic-2.0 | file LICENSE |
| Version: | 0.0.1 |
| Built: | 2026-11-17 00:07:13 UTC |
| Source: | https://github.com/Cardinalverse/CardinalCore |
Longer description of package.
Detailed description of package.
See browseVignettes("CardinalCore") to view a user guide and vignettes of common workflows.
Kylie A. Bemis
Maintainer: Kylie A. Bemis <[email protected]>
Smooth a uniformly sampled 1D signal.
# Moving average filter filt1_mean(y, k = 5L) # Linear convolution filter filt1_conv(y, w = rep(1, 5L))# Moving average filter filt1_mean(y, k = 5L) # Linear convolution filter filt1_conv(y, w = rep(1, 5L))
y |
A numeric vector. |
k |
The number of samples in the smoothing window. Must be positive. Must be odd. |
w |
The weights of the linear convolution kernel. Length must be odd. |
All filters documented here extend the signal by replicating the endpoints.
filt1_mean() performs mean filtering in O(n) time. This is fast and especially useful for calculating other filters that can be constructed as a combination of mean filters.
filt1_conv() performs a convolution filtering with arbitary weights. The weights are internally normalized to sum to 1.
A numeric vector the same length as y with the smoothed result.
Kylie A. Bemis
set.seed(1) x <- seq(from=0, to=6 * pi, length.out=5000) y <- sin(x) + 0.6 * sin(2.6 * t) y <- y + runif(length(y)) z <- filt1_mean(y, k=25) plot(y, type="l") lines(z, col="red")set.seed(1) x <- seq(from=0, to=6 * pi, length.out=5000) y <- sin(x) + 0.6 * sin(2.6 * t) y <- y + runif(length(y)) z <- filt1_mean(y, k=25) plot(y, type="l") lines(z, col="red")