# toy-example:
shape <- c(10, 10, 10)
vox2ras <- matrix(
c(10, 17.32, 0, -136,
-17.32, 10, 20, -63,
0, -20, 0, 100,
0, 0, 0, 1),
nrow = 4, byrow = TRUE
)
# continuous
x <- abs(array(sin(seq_len(100) / 10), shape))
underlay <- ieegio::as_ieegio_volume(x, vox2ras = vox2ras)
overlay <- ieegio::as_ieegio_volume(x > 0.2, vox2ras = vox2ras)
if(interactive()) {
plot_volume_slices(
underlay, overlay = overlay,
depths = seq(0, 150, length.out = 4), pixel_width = 5,
overlay_col = c("#00000000", "#FF000044", "#FF0000FF")
)
}
# Require `install_subject("yael_demo_001")`
if(has_rave_subject("YAEL/yael_demo_001")) {
subject <- ravecore::as_rave_subject("YAEL/yael_demo_001",
strict = FALSE)
t1 <- file.path(subject$imaging_path, "coregistration",
"MRI_reference.nii.gz")
ct <- file.path(subject$imaging_path, "coregistration",
"CT_RAW.nii.gz")
transform <- read.table(
file.path(subject$imaging_path, "coregistration",
"CT_IJK_to_MR_RAS.txt")
)
ct_image_original <- ieegio::read_volume(ct)
ct_image_aligned <- ieegio::as_ieegio_volume(
ct_image_original[], vox2ras = as.matrix(transform)
)
if(interactive()) {
plot_volume_slices(
t1, overlay = ct_image_aligned,
overlay_col = c("#00000000", "#FF000044", "#FF0000FF"),
nc = 6
)
}
}
Run the code above in your browser using DataLab