Description Usage Arguments Note Author(s) See Also Examples
Create and display images for the pixel data of an imaging dataset using a formula interface.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 | ## S4 method for signature 'formula'
image(x, data = environment(x), ...,
xlab, ylab, zlab, subset)
#### Methods for Cardinal >= 2.x classes ####
## S4 method for signature 'PositionDataFrame'
image(x, formula,
groups = NULL,
superpose = FALSE,
strip = TRUE,
key = superpose || !is.null(groups),
normalize.image = c("none", "linear"),
contrast.enhance = c("none", "suppression", "histogram"),
smooth.image = c("none", "gaussian", "adaptive"),
...,
xlab, xlim,
ylab, ylim,
zlab, zlim,
asp = 1,
layout,
col = discrete.colors,
colorscale = viridis,
colorkey = !key,
alpha.power = 1,
subset = TRUE,
add = FALSE)
## S4 method for signature 'SparseImagingExperiment'
image(x, formula,
feature,
feature.groups,
groups = NULL,
superpose = FALSE,
strip = TRUE,
key = superpose || !is.null(groups),
fun = mean,
normalize.image = c("none", "linear"),
contrast.enhance = c("none", "suppression", "histogram"),
smooth.image = c("none", "gaussian", "adaptive"),
...,
xlab, xlim,
ylab, ylim,
zlab, zlim,
asp = 1,
layout,
col = discrete.colors,
colorscale = viridis,
colorkey = !key,
alpha.power = 1,
subset = TRUE,
add = FALSE)
## S4 method for signature 'SparseImagingExperiment'
image3D(x, formula, ..., alpha.power = 2)
## S4 method for signature 'MSImagingExperiment'
image(x, formula,
feature = features(x, mz=mz),
feature.groups,
mz,
plusminus,
...)
## S4 method for signature 'SparseImagingResult'
image(x, formula,
model = modelData(x),
superpose = is_matrix,
...,
column,
colorscale = cividis,
colorkey = !superpose,
alpha.power = 2)
## S4 method for signature 'PCA2'
image(x, formula,
values = "scores", ...)
## S4 method for signature 'PLS2'
image(x, formula,
values = c("fitted", "scores"), ...)
## S4 method for signature 'SpatialFastmap2'
image(x, formula,
values = "scores", ...)
## S4 method for signature 'SpatialKMeans2'
image(x, formula,
values = "cluster", ...)
## S4 method for signature 'SpatialShrunkenCentroids2'
image(x, formula,
values = c("probability", "class", "scores"), ...)
## S4 method for signature 'SpatialDGMM'
image(x, formula,
values = c("probability", "class", "mean"), ...)
## S4 method for signature 'MeansTest'
image(x, formula,
values = "mean", jitter = TRUE, ...)
## S4 method for signature 'SegmentationTest'
image(x, formula,
values = c("mean", "mapping"), jitter = TRUE, ...)
## S4 method for signature 'AnnotatedImage'
image(x, frame = 1, offset = coord(x),
height, width,
layout = !add,
native = TRUE,
interpolate = TRUE,
add = FALSE, ...)
## S4 method for signature 'AnnotatedImageList'
image(x, i, frame = 1,
strip = TRUE,
layout = !add,
native = TRUE,
interpolate = TRUE,
add = FALSE, ...)
## S4 method for signature 'AnnotatedImagingExperiment'
image(x, i, frame = 1, ...)
#### Methods for Cardinal 1.x classes ####
## S4 method for signature 'SImageSet'
image(x, formula = ~ x * y,
feature,
feature.groups,
groups = NULL,
superpose = FALSE,
strip = TRUE,
key = superpose,
fun = mean,
normalize.image = c("none", "linear"),
contrast.enhance = c("none", "suppression", "histogram"),
smooth.image = c("none", "gaussian", "adaptive"),
...,
xlab, xlim,
ylab, ylim,
zlab, zlim,
layout,
asp = 1,
col = rainbow(nlevels(groups)),
col.regions = intensity.colors(100),
colorkey = !is3d,
subset = TRUE,
lattice = FALSE)
## S4 method for signature 'SImageSet'
image3D(x, formula = ~ x * y * z, ...)
## S4 method for signature 'MSImageSet'
image(x, formula = ~ x * y,
feature = features(x, mz=mz),
feature.groups,
mz,
plusminus,
...)
## S4 method for signature 'ResultSet'
image(x, formula,
model = pData(modelData(x)),
feature,
feature.groups,
superpose = TRUE,
strip = TRUE,
key = superpose,
...,
column,
col = if (superpose) rainbow(nlevels(feature.groups)) else "black",
lattice = FALSE)
## S4 method for signature 'CrossValidated'
image(x, fold = 1:length(x), layout, ...)
## S4 method for signature 'PCA'
image(x, formula = substitute(mode ~ x * y),
mode = "scores",
...)
## S4 method for signature 'PLS'
image(x, formula = substitute(mode ~ x * y),
mode = c("fitted", "scores", "y"),
...)
## S4 method for signature 'OPLS'
image(x, formula = substitute(mode ~ x * y),
mode = c("fitted", "scores", "Oscores", "y"),
...)
## S4 method for signature 'SpatialFastmap'
image(x, formula = substitute(mode ~ x * y),
mode = "scores",
...)
## S4 method for signature 'SpatialShrunkenCentroids'
image(x, formula = substitute(mode ~ x * y),
mode = c("probabilities", "classes", "scores"),
...)
## S4 method for signature 'SpatialKMeans'
image(x, formula = substitute(mode ~ x * y),
mode = "cluster",
...)
|
x |
An imaging dataset. |
formula |
A formula of the form 'z ~ x * y | g1 * g2 * ...' (or equivalently, 'z ~ x + y | g1 + g2 + ...'), indicating a LHS 'y' (on the y-axis) versus a RHS 'x' (on the x-axis) and conditioning variables 'g1, g2, ...'. Usually, the LHS is not supplied, and the formula is of the form '~ x * y | g1 * g2 * ...', and the y-axis is implicityl assumed to be the feature vectors corresponding to each pixel in the imaging dataset specified by the object 'x'. However, a variable evaluating to a vector of pixel values, or a sequence of such variables, can also be supplied. The RHS is evaluated in The conditioning variables are evaluated in |
data |
A |
mz |
The m/z value(s) for which to plot the ion image(s). |
plusminus |
If specified, a window of m/z values surrounding the one given by |
feature |
The feature or vector of features for which to plot the image. This is an expression that evaluates to a logical or integer indexing vector. |
feature.groups |
An alternative way to express a single conditioning variable. This is a variable or expression to be evaluated in |
groups |
A variable or expression to be evaluated in |
superpose |
Should feature vectors from different feature groups specified by 'feature.groups' be superposed on the same plot? If 'TRUE' then the 'groups' argument is ignored. |
strip |
Should strip labels indicating the plotting group be plotting along with the each panel? Passed to 'strip' in |
key |
A logical, or |
fun |
A function to apply over pixel vectors of images grouped together by 'feature.groups'. By default, this is used for averaging over features. |
normalize.image |
Normalization function to be applied to each image. The function can be user-supplied, of one of 'none' or 'linear'. The 'linear' normalization method normalized each image to the same intensity range using a linear transformation. |
contrast.enhance |
Contrast enhancement function to be applied to each image. The function can be user-supplied, or one of 'none', 'histogram', or 'suppression'. The 'histogram' equalization method flatterns the distribution of intensities. The hotspot 'suppression' method uses thresholding to reduce the intensities of hotspots. |
smooth.image |
Image smoothing function to be applied to each image. The function can be user-supplied, or one of 'none', 'gaussian', or 'adaptive'. The 'gaussian' smoothing method smooths images with a simple gaussian kernel. The 'adaptive' method uses bilateral filtering to preserve edges. |
xlab |
Character or expression giving the label for the x-axis. |
ylab |
Character or expression giving the label for the y-axis. |
zlab |
Character or expression giving the label for the z-axis. (Only used for plotting 3D images.) |
xlim |
A numeric vector of length 2 giving the left and right limits for the x-axis. |
ylim |
A numeric vector of length 2 giving the top and bottom limits for the y-axis. |
zlim |
A numeric vector of length 2 giving the lower and upper limits for the z-axis (i.e., the range of colors to be plotted). |
layout |
The layout of the plots, given by a length 2 numeric as |
asp |
The aspect ratio of the plot. |
col |
A specification for the default plotting color(s) for groups. |
colorscale |
The color scale to use for the z-axis of image intensities. This may be either a vector of colors or a function which takes a single numeric argument |
col.regions |
The default plotting color(s) for the z-axis of image intensities. Thus must be a vector of colors. |
colorkey |
Should a coloykey describing the z-axis be drawn with the plot? |
alpha.power |
Opacity scaling factor (1 is linear). |
jitter |
Should a small amount of noise be added to the image values before plotting them? |
subset |
An expression that evaluates to a logical or integer indexing vector to be evaluated in |
... |
Additional arguments passed to the underlying |
i |
Which data element should be plotted. |
frame |
Which frame of an image should be plotted. |
offset |
Absolute offset in x/y coordinates of the top-left corner of the image (from the origin). |
height |
The height of the plotted image. |
width |
The width of the plotted image. |
native |
Should a native raster (using integer color codes) be produced, or an rgb raster (using character color codes)? |
interpolate |
Should any linear interpolation be done when plotting the image? |
fold |
What folds of the cross-validation should be plotted. |
model |
A vector or |
mode |
What kind of results should be plotted. This is the name of the object to plot in the |
values |
What kind of results should be plotted. This is the name of the object to plot in the |
column |
What columns of the results should be plotted. If the results are a matrix, this corresponds to the columns to be plotted, which can be indicated either by numeric index or by name. |
lattice |
Should lattice graphics be used to create the plot? |
add |
Should the method call |
In most cases, calling image3D(obj)
is equivalent to image(obj, ~ x * y * z)
.
Kylie A. Bemis
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | setCardinalBPPARAM(SerialParam())
set.seed(1)
x <- simulateImage(preset=2, npeaks=10, dim=c(10,10))
m <- mz(metadata(x)$design$featureData)
image(x, mz=m[1], plusminus=0.5)
image(x, mz=m[1], smooth.image="gaussian", contrast.enhance="histogram")
image(x, mz=m[1], colorscale=col.map("grayscale"))
image(x, mz=m[4:7], colorscale=col.map("cividis"))
image(x, mz=m[c(1,8)], normalize.image="linear", superpose=TRUE)
sm <- summarizePixels(x, FUN=c(tic="sum"), as="DataFrame")
pData(x)$tic <- sm$tic
image(x, tic ~ x * y, colorscale=magma)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.