# NOT RUN {
fsbrain::download_optional_data();
subjects_dir = fsbrain::get_optional_data_filepath("subjects_dir");
atlas = 'aparc'; # Desikan atlas
# For the left hemisphere, we just assign a subset of the
# atlas regions. The others will get the default value.
lh_region_value_list = list("bankssts"=0.9, "precuneus"=0.7, "postcentral"=0.8, "lingual"=0.6);
# For the right hemisphere, we retrieve the full list of regions for
# the atlas, and assign random values to all of them.
atlas_region_names = get.atlas.region.names(atlas, template_subjects_dir = subjects_dir,
template_subject='subject1');
rh_region_value_list = rnorm(length(atlas_region_names), 3.0, 1.0);
names(rh_region_value_list) = atlas_region_names;
vis.region.values.on.subject(subjects_dir, 'subject1', atlas,
lh_region_value_list, rh_region_value_list);
# }
# NOT RUN {
# }
Run the code above in your browser using DataCamp Workspace