Learn R Programming

fsbrain (version 0.1.0)

volvis.contour: Visualize contour of a volume.

Description

Compute a smoothed surface from the voxel intensities in the given volume and render it. Requires the `misc3d` package to be installed, which is an optional dependency.

Usage

volvis.contour(volume, level = 80, show = TRUE)

Arguments

volume

a 3D brain volume

level

numeric, intensity threshold for the data. Voxels with intensity value smaller than `level` will be ignored when creating the contour surface.

show

logical, whether to display the triangles. Defaults to `TRUE`.

Value

the rendered triangles (a `Triangles3D` instance) with coordinates in surface RAS space if any, `NULL` otherwise.

Examples

Run this code
# NOT RUN {
   fsbrain::download_optional_data();
   subjects_dir = fsbrain::get_optional_data_filepath("subjects_dir");
   brain = subject.volume(subjects_dir, 'subject1', 'brain');
   # Plot all voxels of the brain:
   volvis.contour(brain);
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab