fsbrain (version 0.0.2)

vis.subject.morph.standard: Visualize native space morphometry data for a 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.subject.morph.standard(subjects_dir, subject_id, measure, hemi, fwhm,
  surface = "white", template_subject = "fsaverage",
  template_subjects_dir = NULL, colormap = squash::jet,
  views = c("t4"), rgloptions = list(), rglactions = list(),
  draw_colorbar = FALSE)

Arguments

subjects_dir,

string. The FreeSurfer SUBJECTS_DIR, i.e., a directory containing the data for all your subjects, each in a subdir named after the subject identifier.

subject_id,

string. The subject identifier.

measure,

string. The morphometry data to use. E.g., 'area' or 'thickness.'

hemi,

string, one of 'lh', 'rh', or 'both'. The hemisphere name. Used to construct the names of the label data files to be loaded.

fwhm,

string, smoothing setting. The smoothing part of the filename, typically something like '0', '5', '10', ..., or '25'.

surface,

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

template_subject

The template subject used. This will be used as part of the filename, and its surfaces are loaded for data visualization. Defaults to 'fsaverage'.

template_subjects_dir

The template subjects dir. If NULL, the value of the parameter 'subjects_dir' is used. Defaults to NULL. If you have FreeSurfer installed and configured, and are using the standard fsaverage subject, try passing the result of calling 'file.path(Sys.getenv('FREESURFER_HOME'), 'subjects')'.

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.data.on.subject, vis.region.values.on.subject, vis.subject.annot, vis.subject.label, vis.subject.morph.native

Examples

Run this code
# NOT RUN {
   fsbrain::download_optional_data();
   subjects_dir = fsbrain::get_optional_data_filepath("subjects_dir");
   fsaverage_dir = file.path(Sys.getenv('FREESURFER_HOME'), 'subjects');
   if(dir.exists(fsaverage_dir)) {
       vis.subject.morph.standard(subjects_dir, 'subject1', 'thickness', 'lh',
       '10', template_subjects_dir=fsaverage_dir);
   }
   # The last command will load the file
   #  *<subjects_dir>/subject1/surf/lh.thickness.fwhm10.fsaverage.mgh* and
   #  visualize the data on *$FREESURFER_HOME/subjects/fsaverage/surf/lh.white*.
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab