# toy example; in practice, use tha path to the volume
volume <- array(0, dim = rep(30, 3))
volume[11:20, 11:20, 3:28] <- 1
volume[3:28, 11:20, 11:20] <- 1
volume[11:20, 3:28, 11:20] <- 1
vox2ras <- diag(1, 4)
surf <- volume_to_surface(volume, vox2ras = vox2ras)
if(interactive()) {
plot(surf)
}
Run the code above in your browser using DataLab