Description Usage Arguments Value Multi-channel image and segmentation mask objects Linking SingleCellExperiment and CytoImageList objects Setting the colours Subsetting the CytoImageList objects Subsetting the SingleCellExperiment object Colour scaling Author(s) See Also Examples
This function takes a CytoImageList
object to colour
pixels by marker expression. Additionally, a
SingleCellExperiment
object and CytoImageList
object containing segmentation masks can be provided to outline cells based
on metadata.
1 2 3 4 5 6 7 8 9 10 11 12 |
image |
a |
object |
an optional |
mask |
an optional |
cell_id |
character specifying the |
img_id |
character specifying the |
colour_by |
character or character vector specifying the features
(contained in |
outline_by |
single character indicating the |
bcg |
a list with names matching the entries to
Default is c(0,1,1). |
colour |
a list with names matching the entries to |
... |
Further arguments passed to |
a list if return_images
and/or return_plot
is TRUE (see ?"plotting-param"
).
plot
: a single plot object (display = "all"
) or a list
of plot objects (display = "single"
)
images
: a SimpleList
object containing
three-colour Image
objects.
In the plotPixels
function, image
refers to a
CytoImageList
object that contains a single or multiple
single- or multi-channel Image
objects. Up to six
channels can be overlayed to generate a composite image. When outlining
cells, a SingleCellExperiment
object and
CytoImageList
object containing segmentation masks must
be provided. The function assumes that each object in the segmentation mask
is a cell. The key features of such segmentation masks include:
each Image object contains only one channel
pixel values are integers indicating the cells' IDs
To outline individual cells contained in the segmentation masks based on
metadata stored in the SingleCellExperiment object, an img_id
and
cell_id
entry needs to be provided. Image IDs are matched between the
SingleCellExperiment
and CytoImageList
objects via entries to
the colData(object)[,img_id]
, mcols(image)[,img_id]
and the
mcols(image)[,img_id]
slots. Cell IDs are matched between the
SingleCellExperiment
and CytoImageList
object via entries to
colData(object)[,cell_id]
and the integer values of the segmentation
masks.
By default, features and metadata are coloured based on internally-set
colours. To set new colours, a list
object must be provided. The names
of the object must correspond to the entries to colour_by
and/or
outline_by
. When setting the colours for continous expression values
or continous metadata entries, a vector of at least two colours need to be
specified. These colours will be passed onto colorRampPalette
for interpolation. Cells can be outlined by discrete metadata entries when
specifying a named vector in which each entry corresponds to a unique entry
to the metadata vector.
CytoImageList
objectsThe CytoImageList
object(s) can be subsetted before calling the
plotPixels
function. In that case, only the selected images are
displayed.
SingleCellExperiment
objectThe SingleCellExperiment
object can be subsetted before calling the
plotPixels
function. In that case, only cells contained in the
SingleCellExperiment
object are outlined.
When plotting pixel intensities, colours are scaled to the minimum and maximum per channel across all images that are being displayed. Therefore, when subsetting images, displayed intensities might change. However, the colour legend will display the correct numeric minimum and maximum pixel intensity across all displayed images per channel.
Nils Eling (nils.eling@dqbm.uzh.ch)
Nicolas Damond (nicolas.damond@dqbm.uzh.ch)
For further plotting parameters see ?"plotting-param"
.
For instructions on how to normalize images see
normalize
.
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 | data(pancreasMasks)
data(pancreasImages)
data(pancreasSCE)
# Visualize the images - by default the first channel
plotPixels(pancreasImages)
# Colour the channels
plotPixels(pancreasImages, colour_by = c("CD99", "CDH"))
# Outline the cells based on metadata
plotPixels(pancreasImages, object = pancreasSCE, mask = pancreasMasks,
img_id = "ImageNb", cell_id = "CellNb",
colour_by = c("CD99", "CDH"), outline_by = "CellType")
# Enhance individual channels
plotPixels(pancreasImages, colour_by = c("CD99", "CDH"),
bcg = list(CD99 = c(0, 2, 1)))
# Subset the images
cur_images <- getImages(pancreasImages, 1:2)
plotPixels(cur_images, colour_by = c("CD99", "CDH"))
# Set colour
plotPixels(pancreasImages, colour_by = c("CD99", "CDH"),
colour = list(CD99 = c("black", "green"),
CDH = c("black", "blue")))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.