View source: R/CytoImageList.R
CytoImageList-class | R Documentation |
This class facilitates the handling of multiple one- or multi-channel images.
It inherits from SimpleList
setting
elementType="Image"
. Therefore, each slot contains an either one- or
multi-dimensional array in form of an Image
object.
CytoImageList(
...,
on_disk = FALSE,
h5FilesPath = NULL,
BPPARAM = SerialParam()
)
... |
A list of images (or coercible to a list) or individual images |
on_disk |
Logical indicating if images in form of HDF5Array objects (as .h5 files) should be stored on disk rather than in memory. |
h5FilesPath |
path to where the .h5 files for on disk representation
are stored. This path needs to be defined when |
BPPARAM |
parameters for parallelised processing.
This is only recommended for very large images.
See |
Similar to the Image
class, the first two
dimensions of each entry indicate the spatial dimension of the image. These
can be different for each entry. The third dimension indicates the number
of channels per Image. Each entry in the CytoImageList class object must
contain the same number of channels. Here, each channel represents pixel
values indicating measurement intensities or in case of segmentation masks
the cells' ID. The CytoImageList class therefore only supports a Grayscale
colormode (see colormode
) representation of each
individual image.
The class further contains an elementMetadata
slot that
stores image-level meta information. This slot should be accessed using the
mcols
accessor function.
A CytoImageList object
The CytoImageList class only supports unique entry names to avoid duplicated
images. Names of a CytoImageList object can be get and set via
names(x)
, where x
is a CytoImageList object. Furthermore, only
named or unnamed CytoImageList objects are allowed. Partially named objects
causing empty or NA names return an error.
Coercion to and from list, SimpleList
and
List
:
Coercion from a CytoImageList object x
Coercion from a list, SimpleList or List
object x
to anCytoImageList object
While lapply
and mapply
return
regular list objects, endoapply
and
mendoapply
return CytoImageList objects.
When setting on_disk = TRUE
and specifying the h5FilesPath
,
images are stored on disk. To convert back to an in-memory
CytoImageList
object, one can call
CytoImageList(on_disk_IL, on_disk = FLASE)
.
Nils Eling (nils.eling@dqbm.uzh.ch)
Image
, for further image analysis tools.
SimpleList
, for basics functions to handle SimpleList
objects
?loadImages
, for reading images into a CytoImageList
object
?"CytoImageList-naming"
, for setting and getting image and
channel names
?"CytoImageList-subsetting"
, for subsetting and
accessor functions
# Creation of CytoImageList
u <- matrix(rbinom(100, 10, 0.5), ncol=10, nrow=10)
v <- matrix(rbinom(100, 10, 0.5), ncol=10, nrow=10)
IL1 <- CytoImageList(image1 = Image(u), image2 = Image(v))
# Coercion
as.list(IL1)
as(IL1, "SimpleList")
as(list(image1 = Image(u), image2 = Image(v)), "CytoImageList")
# On disk representation
IL1 <- CytoImageList(image1 = Image(u), image2 = Image(v),
on_disk = TRUE,
h5FilesPath = HDF5Array::getHDF5DumpDir())
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.