R/methods2-MSContinuousImagingExperiment.R

# 'continuous' imaging experiments

setReplaceMethod("imageData", "MSContinuousImagingExperiment",
	function(y, value) {
		if ( !inherits(value, c("MSContinuousImagingSpectraList")) ) {
			y <- as(y, "MSImagingExperiment")
			imageData(y) <- value
		} else {
			y <- callNextMethod(y, value)
		}
		y
	})

setReplaceMethod("iData", c("MSContinuousImagingExperiment", "ANY"),
	function(x, i, ..., value) {
		if ( !inherits(value, c("matrix", "matter_matc")) ) {
			x <- as(x, "MSImagingExperiment")
			imageData(x) <- .SimpleImageArrayList(imageData(x))
			iData(x, i, ...) <- value
		} else {
			x <- callNextMethod(x, i, ..., value=value)
		}
		x
	})

setReplaceMethod("iData", c("MSContinuousImagingExperiment", "missing"),
	function(x, i, ..., value) {
		if ( !inherits(value, c("matrix", "matter_matc")) ) {
			x <- as(x, "MSImagingExperiment")
			imageData(x) <- .SimpleImageArrayList(imageData(x))
			iData(x, ...) <- value
		} else {
			x <- callNextMethod(x, ..., value=value)
		}
		x
	})

Try the Cardinal package in your browser

Any scripts or data that you put into this service are public.

Cardinal documentation built on Nov. 8, 2020, 11:10 p.m.