View source: R/utils_generate_subcortical_surf.R
volume_to_surf | R Documentation |
'nii'
or 'mgz'
volume filesGenerate surface file from 'nii'
or 'mgz'
volume files
volume_to_surf(
volume,
save_to = NA,
lambda = 0.2,
degree = 2,
threshold_lb = 0.5,
threshold_ub = NA,
format = "auto"
)
volume |
path to the volume file, or object from |
save_to |
where to save the surface file; default is |
lambda |
|
degree |
|
threshold_lb |
lower threshold of the volume (to create mask); default is |
threshold_ub |
upper threshold of the volume; default is |
format |
The format of the file if
|
Triangle 'rgl'
mesh (vertex positions in native 'RAS'
). If save_to
is a valid path, then the mesh will be saved to this location.
read_volume
, vcg_isosurface
,
vcg_smooth_implicit
library(threeBrain)
N27_path <- file.path(default_template_directory(), "N27")
if(dir.exists(N27_path)) {
aseg <- file.path(N27_path, "mri", "aparc+aseg.mgz")
# generate surface for left-hemisphere insula
mesh <- volume_to_surf(aseg, threshold_lb = 1034,
threshold_ub = 1036)
if(interactive()) {
ravetools::rgl_view({
ravetools::rgl_call("shade3d", mesh, color = "yellow")
})
}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.