burn_volume {ieegio} | R Documentation |
Burn image at given positions
Description
Burn image at given positions with given color and radius.
Usage
burn_volume(
image,
ras_position,
col = "red",
radius = 1,
reshape = FALSE,
alpha = FALSE,
blank_underlay = FALSE,
...,
preview = NULL
)
Arguments
image |
volume |
ras_position |
image-defined right-anterior-posterior positions, an
|
col |
vector of integer or characters, color of each contact |
radius |
vector of positive number indicating the burning radius |
reshape |
whether to reshape the image at a different resolution;
default is false; can be |
alpha |
whether to include alpha (transparent) channel. Default is
false for compatibility concerns (legacy software might not support
reading alpha channel). In this case, the background will be black.
If |
blank_underlay |
whether to use blank image or the input
|
... |
passed to |
preview |
indices (integer) of the position to visualize; default is
|
Value
Color image that is burnt; see imaging-volume
.
Examples
if(interactive()) {
dim <- c(6, 6, 6)
image <- as_ieegio_volume(
array(rnorm(prod(dim)), dim),
vox2ras = rbind(cbind(diag(1, 3), -dim / 2),
c(0, 0, 0, 1))
)
ras_positions <- rbind(c(1, -1, 1.5), c(-2.25, -1, -0.75))
burned <- burn_volume(
image,
ras_positions,
col = c("red", "green"),
radius = 0.5,
reshape = c(24, 24, 24)
)
plot(
burned,
position = ras_positions[1, ],
zoom = 15,
pixel_width = 0.25
)
}