Here are some ways to visualize the label files (i.e., ROI) for each subject and each hemisphere separately.
Some (redundant) notes: you always have to set up FreeSurfer properly before using freeview or tksurfer (steps).
-
Load the surface for one subject with (in terminal):
tksurferfv fsaverage lh inflated
fsaverage
: display the results on thefsaverage
surface, it could be any subject code (i.e., folder name in$SUBJECTS_DIR
);lh
(orrh
): left (or right) hemisphere;inflated
: display the inflated brain;
-
You may visualize multiple labels with different colors (do not forget to rotate the brain to get the best view).
-
Load the surface for one subject with:
tksurfer fsaverage lh inflated -curv -gray
fsaverage
: display the results on thefsaverage
surface, it could be any subject code (i.e., folder name in$SUBJECTS_DIR
);lh
(orrh
): left (or right) hemisphere;inflated
: display the inflated brain;-curv
: show the curvature;-gray
: show the curvature as gray.
- You may also change the color of labels by clicking the label on the surface and then choose the color you want.
knkutils and cvncode are super useful for visualizing fMRI results on brain surfaces (in Matlab).
An example Matlab code to display bilateral V1 and V2 for fsaverage is as following:
% set SUBJECTS_DIR for FreeSurfer
subjdir = '/full/path/to/subject/dir';
setenv('SUBJECTS_DIR', subjdir);
% get the number of vertices
vtx_lh = read_surf(fullfile(subjdir, 'fsaverage', 'surf', 'lh.white'));
vtx_rh = read_surf(fullfile(subjdir, 'fsaverage', 'surf', 'rh.white'));
nVtx_lh = size(vtx_lh, 1);
nVtx_rh = size(vtx_rh, 1);
% load the labels
label_v1_lh = read_label('fsaverage', 'lh.V1_exvivo');
label_v2_lh = read_label('fsaverage', 'lh.V2_exvivo');
label_v1_rh = read_label('fsaverage', 'rh.V1_exvivo');
label_v2_rh = read_label('fsaverage', 'rh.V2_exvivo');
% convert the label file into binary roimask
roi_v1 = zeros(nVtx_lh + nVtx_rh, 1);
roi_v1([label_v1_lh(:, 1)+1; label_v1_rh(:, 1)+1+nVtx_lh], 1) = 1;
roi_v2 = zeros(nVtx_lh + nVtx_rh, 1);
roi_v2([label_v2_lh(:, 1)+1; label_v2_rh(:, 1)+1+nVtx_lh], 1) = 1;
rois = cell(2, 1);
rois{1} = logical(roi_v1);
rois{2} = logical(roi_v2);
% create "dummy" data
data = zeros(nVtx_lh + nVtx_rh, 1);
% display the ROIs
cvnlookup('fsaverage', 5, data, '', '', 1i, '', '', ...
{'roimask', rois, 'roicolor', {'y', 'g'}});
Note:
- You may have to copy the fsaverage to somewhere you have rights to write for running this example.
read_label()
andread_surf()
are FreeSurfer Matlab functions. You need to add these functions to the Matlab path. These FreeSurfer Matlab functions should be at e.g.,/Applications/FreeSurfer/matlab
.- For the arguments in
cvnlookup()
, please check its help file.
The output should be something like:
Please refer to help file for fs_cvn_printlabel()
.