| plot,NeuroSlice-method | R Documentation |
Display axial slices of a NeuroVol as a faceted
montage.
## S4 method for signature 'NeuroSlice,ANY'
plot(
x,
cmap = gray(seq(0, 1, length.out = 255)),
irange = range(x, na.rm = TRUE),
legend = TRUE
)
## S4 method for signature 'NeuroVol,missing'
plot(
x,
y,
cmap = "grays",
zlevels = unique(round(seq(1, dim(x)[3], length.out = 9))),
irange = range(x, na.rm = TRUE),
thresh = c(0, 0),
alpha = 1,
legend = TRUE
)
## S4 method for signature 'NeuroVol,NeuroVol'
plot(
x,
y,
cmap = "grays",
zlevels = unique(round(seq(1, dim(x)[3], length.out = 9))),
ov_cmap = "inferno",
ov_alpha = 0.5,
ov_thresh = 0
)
x |
the background volume to display. |
cmap |
palette name or hex-color vector for the background
(default |
irange |
numeric length-2 intensity range for the color scale. |
legend |
logical; show the colour bar? |
y |
optional overlay volume (same dimensions as |
zlevels |
integer slice indices to display.
Default: 9 evenly-spaced slices (3 |
thresh |
a 2-element vector indicating the lower and upper transparency thresholds. |
alpha |
opacity for the background layer (0–1). |
ov_cmap |
overlay palette name (default |
ov_alpha |
overlay opacity (default 0.5). |
ov_thresh |
overlay threshold; values with
|
The plot method uses ggplot2 to create a raster visualization of the slice data.
The intensity values are mapped to colors using the specified colormap and range.
when 'x' is a NeuroSlice object, the plot method returns a ggplot2 object containing the raster visualization of the slice data.
The plot can be further customized using standard ggplot2 functions.
When a second volume y is supplied it is treated as an overlay
(e.g.\ a statistical map) composited on top of x with
adjustable transparency. This delegates to plot_overlay.
a ggplot2 object
# Create example slice
slice_space <- NeuroSpace(c(100, 100))
slice_data <- matrix(rnorm(100*100), 100, 100)
slice <- NeuroSlice(slice_data, slice_space)
# Basic plot
plot(slice)
dat <- matrix(rnorm(100*100), 100, 100)
slice <- NeuroSlice(dat, NeuroSpace(c(100,100)))
plot(slice)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.