plotImages.Rd
Plots all images registered the SPATA2
object.
plotImages(object, ...)
# S4 method for class 'SPATA2'
plotImages(
object,
img_names = getImageNames(object),
by_section = TRUE,
outline = FALSE,
outline_ref = FALSE,
fragments = TRUE,
line_alpha = line_alpha_ref * 0.75,
line_alpha_ref = 1,
line_color = "black",
line_color_ref = "red",
line_size = 0.5,
line_size_ref = line_size * 1.5,
transform = TRUE,
img_alpha = 1,
against_ref = FALSE,
alignment_eval = FALSE,
ncol = NULL,
nrow = NULL,
verbose = TRUE
)
# S4 method for class 'SpatialData'
plotImages(
object,
img_names = NULL,
ncol = NULL,
nrow = NULL,
image = TRUE,
outline = FALSE,
outline_ref = FALSE,
by_section = TRUE,
fragments = TRUE,
line_alpha = line_alpha_ref * 0.75,
line_alpha_ref = 1,
line_color = "black",
line_color_ref = "red",
line_size = 0.5,
line_size_ref = line_size * 1.5,
transform = TRUE,
img_alpha = 1,
against_ref = FALSE,
alignment_eval = FALSE,
verbose = TRUE
)
An object of class SPATA2
or, in case of S4 generics,
objects of classes for which a method has been defined.
Additional arguments given to plotImage()
.
Character vector or NULL
. If character, specifies the images
by name. If NULL
, all images are plotted.
Logical value. If TRUE
, the default, the outline for every
tissue section identified is used.
Logical value. If TRUE
, all images are plotted with the outline
identified by identifyTissueOutline(..., method = "image")
.
Logical value. If TRUE
, all images plotted with
the outline identified by identifyTissueOutline(..., method = "image")
of the
reference image.
Numeric. Affects alpha of main lines of the plot.
Character value. The color for the outline if
outline = TRUE
and/or outline_ref = TRUE
.
Character value. The linewidth for the outline if
outline = TRUE
and/or outline_ref = TRUE
.
Logical value. Should the instructions for image transformation
set with alignImage()
be applied?
Numeric value. Sets the transparency for the image.
Numeric values or NULL. Used to arrange multiple plots.
Logical. If TRUE
, informative messages regarding
the computational progress will be printed.
(Warning messages will always be printed.)
A ggplot assembled with via patchwork::wrap_plots()
.
The vignette on distance measures in SPATA2 has been replaced. Click
here
to read it.
When comparing the output of ggplot() + ggpLayerImage()
with other image plotting functions,
you may notice that the image appears horizontally flipped when plotted using ggpLayerImage()
.
This behavior is due to the use of a Cartesian coordinate system in SPATA2
, where a pixel
with coordinates c(width = 1, height = 1) is plotted on the left side at the bottom.
In contrast, functions like EBImage::display()
or graphics::plot()
use an image space coordinate system,
where pixel heights start from the top. Consequently, in image space, pixel c(width = 1, height = 1)
is displayed on the top resulting in mirror inverted visualization of the image.
We chose to use a Cartesian coordinate system in SPATA2
because we believe it provides a more intuitive
framework for the spatial alignment of tissue, spatial annotations, spatial trajectories,
barcoded sots, single cells, etc. where coordinates in the corresponding data.frames are provided
in form of x- and y-variables. See getCoordsDf()
, getImgAnnOutlineDf()
, getTissueOutlineDf()
etc.
If you prefer to view your image in the regular orientation, you can use the flipAll()
function on your object,
specifying axis = "horizontal"
, to reverse this effect.