| plotImages | R Documentation | 
Plots all images registered the SPATA2 object.
plotImages(object, ...)
## S4 method for signature '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 signature '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
)
object | 
 An object of class   | 
... | 
 Additional arguments given to   | 
img_names | 
 Character vector or   | 
by_section | 
 Logical value. If   | 
outline | 
 Logical value. If   | 
outline_ref | 
 Logical value. If   | 
line_alpha | 
 Numeric. Affects alpha of main lines of the plot.  | 
line_color, line_color_ref | 
 Character value. The color for the outline if
  | 
line_size, line_size_ref | 
 Character value. The linewidth for the outline if
  | 
transform | 
 Logical value. Should the instructions for image transformation
set with   | 
img_alpha | 
 Numeric value. Sets the transparency for the image.  | 
nrow, ncol | 
 Numeric values or NULL. Used to arrange multiple plots.  | 
verbose | 
 Logical. If  (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.
getImageDirectories(), identifyPixelContent(), identifyTissueOutline()
library(SPATA2)
data("example_data")
object <- example_data$object_UKF275T_diet
plotImages(object)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.