HistoImage
- ClassHistoImage-class.Rd
S4 class that contains an histology image and information and data
about it. Usually live in slot @images of SpatialData
objects.
active
logical. If TRUE
, it is the image used by default. Only one HistoImage
in the SpatialData
object can be the active at a time.
aligned
logical. If TRUE
, indicates that the image was aligned to
the reference image.
bg_color
character. The color of the background.
dir
character. The directory from where to load the image if slot @image is empty.
image
Image. The image stored as class Image
from the package EBImage
.
image_info
list. A list of miscellaneous slots that carrie information regarding the image. Protected slots are:
dims: Numeric vector of length three. Output of base::dim()
on the read image.
name
character. The name of the image.
outline
list. List of two data.frames in which each row corresponds to a vertice of the polygon required to outline the whole tissue identified on the image or single contiguous tissue sections.
tissue_whole: Data.frame of two variables x_orig and y_orig.
tissue_sections: Data.frame of two variables x_orig, y_orig and section to outline the tissue section outlined.
See the vignette about tissue outline
for more information.
overlap
numeric. Numeric vector of length two. Quantifies the overlap
of the tissue outline of this image with the tissue outline of the reference image
with a value between 0-1 before and after alignment via alignImage()
.
pixel_content
factor. Named factor where names correspond to the
pixels following the naming convention 'px_w1_h1' encoding the width and height value
of the pixel from the original not transformed image. Values correspond to
the content the pixel displays. See identifyPixelContent()
for more information.
reference
logical. TRUE
if it is the HistoImage
used as the reference
with which other histology images are aligned.
sample
character. The name of the tissue portion to which this image belongs.
scale_factors
list. List of single numeric values serving as scale factors for multiple purposes Reserved slot names:
image: Image scale factor with which the original x and y variables (x_orig, y_orig) are multiplied with upon extraction of the coordinates data.frame (resulting in the x and y variables) ensuring alignment with the image.
pixel: Pixel scale factor used to convert pixel values into SI units. It must have an attribute called "unit" conforming to the format "SI-unit/px".
See scale factors
for more information.
transformations
list. List of transformations to apply upon extracting the image to ensure alignment with additional images and spatial aspects. In case of default values no transformation is applied.
The following transformations are applied when the image is loaded:
resize_fct: Numeric value between 0-1. Used to resize the resolution of the image.
The following transformations are applied when the image is extracted:
angle: Numeric value that ranges from 0-359. Indicates the angle in degrees by which the image needs to be rotated in clockwise direction. Defaults to 0.
flip: List of two logical values named horizontal and vertical. Indicate
if the image is supposed to be flipped around either axis. Both default to FALSE
stretch: List of two numerical values named horizontal and vertical serving as scale factors with which to stretch the respective axis. Both default to 1.
translate: List of two numeric values named horizontal and vertical. Indicate the number of pixels the image needs to be translated. Positive values shift the image downwards or to the right, respectively. Negative values shift the image upwards or to the left, respectively. Both default to 0.