vis.labeldata.on.subject | R Documentation |
Visualizes a label. Note that a label is just a set of vertices, and that you can use this function to visualize sets of vertices, e.g., to see where on the mesh a certain vertex lies. It may be helpful the visualize the vertex with its neighbors, because otherwise it may be too small to spot. Use the function [fsbrain::mesh.vertex.neighbors] to get them. It is advisable to set the view to the interactive 'si' mode and use the 'inflated' surface to identify single vertices.
vis.labeldata.on.subject(
subjects_dir,
vis_subject_id,
lh_labeldata,
rh_labeldata,
surface = "white",
views = c("t4"),
rgloptions = rglo(),
rglactions = list(),
draw_colorbar = FALSE,
makecmap_options = list(colFn = label.colFn.inv),
style = "default",
...
)
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. |
vis_subject_id |
string. The subject identifier from which to obtain the surface for data visualization. Example: 'fsaverage'. |
lh_labeldata |
integer vector of vertex indices for the left hemisphere |
rh_labeldata |
integer vector of vertex indices for the right hemisphere |
surface |
string. The display surface. E.g., "white", "pial", or "inflated". Defaults to "white". |
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 |
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. The following example clips outliers in the data before plotting and writes a screenshot in PNG format: |
draw_colorbar |
logical or one of the character strings 'vertical' or 'horizontal', whether to draw a colorbar. Notice: the colorbar is drawn to a separate subplot, and this only works if there is enough space for it, i.e., the plot resolution must be high enough. You may have to increase the plot size for the colorbar to show up, see the vignette for instructions. Defaults to 'FALSE'. See |
makecmap_options |
named list of parameters to pass to |
style |
character string, a rendering style, e.g., 'default', 'shiny' or 'semitransparent'. |
... |
extra arguments to pass to |
list of coloredmeshes. The coloredmeshes used for the visualization.
Drawing a colorbar for label data makes limited sense, use a legend instead. The colorbar can give a rough overview of the relative number of label and non-label vertices though, so it is possible to request one.
Other label functions:
apply.label.to.morphdata()
,
apply.labeldata.to.morphdata()
,
subject.lobes()
,
subject.mask()
,
vis.subject.label()
Other visualization functions:
highlight.vertices.on.subject()
,
highlight.vertices.on.subject.spheres()
,
vis.color.on.subject()
,
vis.data.on.fsaverage()
,
vis.data.on.subject()
,
vis.mask.on.subject()
,
vis.region.values.on.subject()
,
vis.subject.annot()
,
vis.subject.label()
,
vis.subject.morph.native()
,
vis.subject.morph.standard()
,
vis.subject.pre()
,
vis.symmetric.data.on.subject()
,
vislayout.from.coloredmeshes()
## Not run:
fsbrain::download_optional_data();
# Define the data to use:
subjects_dir = fsbrain::get_optional_data_filepath("subjects_dir");
lh_labeldata = c(1000, 1001, 1002); # only the vertices, will be tiny.
subject_id = 'subject1';
surface = 'white'; # Should use 'inflated', but we do not currently
# ship it for the example subject to reduce download size.
# For the right hemi, extend them to neighborhood for better visibility:
rh_labeldata = c(500, 5000);
rh_surface = subject.surface(subjects_dir, subject_id, surface, 'rh');
rh_labeldata_neighborhood = mesh.vertex.neighbors(rh_surface, rh_labeldata);
vis.labeldata.on.subject(subjects_dir, subject_id, lh_labeldata,
rh_labeldata_neighborhood$vertices, surface=surface, views=c('si'));
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.