fsbrain (version 0.0.2)

vis.data.on.subject: Visualize arbitrary data on the surface of any subject.

Description

Creates a surface mesh, applies a colormap transform the morphometry data values into colors, and renders the resulting colored mesh in an interactive window. If hemi is 'both', the data is rendered for the whole brain.

Usage

vis.data.on.subject(subjects_dir, vis_subject_id, morph_data_lh,
  morph_data_rh, surface = "white", colormap = squash::jet,
  views = c("t4"), rgloptions = list(), rglactions = list(),
  draw_colorbar = FALSE)

Arguments

subjects_dir,

string. The FreeSurfer SUBJECTS_DIR, containing the subdir of vis_subject_id, the subject that you want to use for visualization.

vis_subject_id,

string. The subject identifier from which to obtain the surface for data visualization. Example: 'fsaverage'.

morph_data_lh,

numeric vector or NULL, the data to visualize on the left hemisphere surface. Must have the same length as the surface of the vis_subject_id has vertices. If NULL, this surface will not be rendered. Only one of morph_data_lh or morph_data_rh is allowed to be NULL.

morph_data_rh,

numeric vector or NULL, the data to visualize on the right hemisphere surface. Must have the same length as the surface of the vis_subject_id has vertices. If NULL, this surface will not be rendered. Only one of morph_data_lh or morph_data_rh is allowed to be NULL.

surface,

string. The display surface. E.g., "white", "pial", or "inflated". Defaults to "white".

colormap,

a colormap. See the squash package for some colormaps. Defaults to [squash::jet].

views,

list of strings. Valid entries include: 'si': single interactive view. 't4': tiled view showing the brain from 4 angles. 't9': tiled view showing the brain from 9 angles.

rgloptions

option list passed to [rgl::par3d()]. Example: rgloptions = list("windowRect"=c(50,50,1000,1000));

rglactions,

named list. A list in which the names are from a set of pre-defined actions. The values can be used to specify parameters for the action.

draw_colorbar

logical, whether to draw a colorbar. WARNING: The colorbar is drawn to a subplot, and this only works if there is enough space for it. You will have to increase the plot size using the 'rlgoptions' parameter for the colorbar to show up. Defaults to FALSE.

Value

list of coloredmeshes. The coloredmeshes used for the visualization.

See Also

Other visualization functions: vis.data.on.fsaverage, vis.region.values.on.subject, vis.subject.annot, vis.subject.label, vis.subject.morph.native, vis.subject.morph.standard

Examples

Run this code
# NOT RUN {
   fsbrain::download_optional_data();
   subjects_dir = fsbrain::get_optional_data_filepath("subjects_dir");
   morph_data_lh = subject.morph.native(subjects_dir, 'subject1', 'thickness', 'lh');
   morph_data_rh = NULL;
   vis.data.on.subject(subjects_dir, 'subject1', morph_data_lh, morph_data_rh);
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace