-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathplotFSurf_example.m
More file actions
63 lines (50 loc) · 1.89 KB
/
plotFSurf_example.m
File metadata and controls
63 lines (50 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
%% recipe for plotting on a surface
% Indiana University
% Computational Cognitive Neurosciene Lab
% See LICENSE file for license
clc
clearvars
addpath(strcat(pwd,'/'))
addpath(strcat(pwd,'/src/external/'))
%% step one
% run the prep_subj (in bash) to get surface in ascii format and to
% potentially get parcellated regions.
%
% a call to that function might look like:
% ./src/external/prep_subj.sh ./example_data/ fsaverage ./example_data/prep_plotFSurf YeoUpsample
% which would put the data we want in the ./example_data/prep_plotFSurf dir
%
%% step two
% read in the data
dataStruct = plotFSurf_read_in_data('./example_data/prep_plotFSurf/lh.inflated.srf',...
'./example_data/prep_plotFSurf/rh.inflated.srf',...
'./example_data/','fsaverage',...
'./example_data/prep_plotFSurf/lh.label_list.txt',...
'./example_data/prep_plotFSurf/rh.label_list.txt',...
0) ;
%% step three
% get values we would like to plot per ROI, and convert these values into
% indices that will be useful for viz
% lets make up some weights
LH_weights = rand(58,1) ;
RH_weights = rand(58,1) ;
% since we know that the first label is the
% Background+FreeSurfer_Defined_Medial_Wall, lets make this first value
% into something outside the 'normal range'
LH_weights(1) = -1 ;
RH_weights(1) = -1 ;
% lets get a nice colormap
cmap_to_use = brewermap(100,'YlOrRd') ;
plotStruct = plotFSurf_setup_parcel_weights(dataStruct,...
LH_weights,RH_weights,cmap_to_use,-1) ;
%% step 4
% viz it using the info from the `dataStruct` & `plotStruct`
plotFSurf_viz_trisurf(dataStruct,...
plotStruct.LH_vals,plotStruct.RH_vals,...
plotStruct.cmap,plotStruct.CDataMapStr,'lh:lat')
%% bonus step!!!
% the viz for annotation is all in one func
% viz for annotation files!
plotFSurf_viz_annot(dataStruct,...
'./example_data/fsaverage/label/lh.YeoUpsample.annot',...
'./example_data/fsaverage/label/rh.YeoUpsample.annot')