process-methods {Cardinal} | R Documentation |
Queue pre-processing steps on an imaging dataset and apply them.
## S4 method for signature 'SparseImagingExperiment' process(object, fun, ..., kind = c("pixel", "feature", "global"), prefun, preargs, postfun, postargs, plotfun, label = "", delay = FALSE, plot = FALSE, par = NULL, outpath = NULL, BPPARAM = bpparam())
object |
An imaging dataset. |
fun |
A function to apply to each feature-vector or image-vector. |
... |
Additional arguments to |
kind |
What kind of processing to perform? Over pixels, over features, or global processing of the dataset as a single unit. |
prefun |
A pre-processing function to be applied to the entire dataset, taking the dataset as its first argument. This should return another object of the same class. |
preargs |
Additional arguments to |
postfun |
A post-processing function to be applied to the output, taking the result as its first argument, and the original dataset as its second argument. This should return another object of the same class as the original dataset. |
postargs |
Additional arguments to |
plotfun |
A function to be used to plot the output of |
label |
The label of the processing step. This is used to identify it in the queue, and is printed as it is being processed. |
delay |
Should the function |
plot |
Plot the function for each pixel or feature while it is being processed? Only possible if |
par |
Plotting parameters to be passed to |
outpath |
The path to a file where the results will be written by |
BPPARAM |
An optional instance of |
This method allows queueing of delayed processing to an imaging dataset. All of the registered processing steps will be applied in sequence whenever process()
is called next with delay=FALSE
. The processing can be over feature-vectors (e.g., mass spectra), over image-vectors, or over the entire dataset as a unit. The processing is performed in parallel using the current registered parallel backend.
An object of the same class (or subclass) as the original imaging dataset, with the data processing queued or applied.
Kylie A. Bemis
SparseImagingExperiment
,
MSImagingExperiment
,
pixelApply
,
featureApply
,
normalize
,
smoothSignal
,
reduceBaseline
,
peakPick
,
peakAlign
,
peakFilter
,
peakBin
register(SerialParam()) set.seed(2) data <- simulateImage(preset=1, dim=c(10,10), baseline=1) data_c <- data[,pData(data)$circle] tmp <- process(data, function(s) log2(abs(s))) tmp1 <- process(data, abs, delay=TRUE) tmp2 <- process(tmp1, log2, delay=TRUE) process(tmp2)