-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcvnlookupdetermineviewpoint.m
42 lines (35 loc) · 1.11 KB
/
cvnlookupdetermineviewpoint.m
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
% This script can be used to help determine new viewpoints to be
% used in cvnlookup.m and cvndefinerois.m.
% load surface
surf = cvnreadsurface('fsaverage','lh','inflated','orig');
curv = cvnreadsurfacemetric('fsaverage','lh','curv',[],'orig');
surf = cvnreadsurface('fsaverage','rh','inflated','orig');
curv = cvnreadsurfacemetric('fsaverage','rh','curv',[],'orig');
% render it
figure; setfigurepos([100 100 900 900]);
h = patch(surf);
set(h,'EdgeColor','none');
%%set(h,'FaceColor',[1 .5 .5]);
set(h,'FaceVertexCData',double(curv<0));
set(h,'FaceColor','interp');
lighting gouraud;
camlight;
axis equal;
% rotate manually
% get the current view (azimuth, elevation)
[az,el] = view
% explicitly set the view
view(-35,40); % lh
view( 35,40); % rh
% define 3-element vector with [A E R]
% where A is azimuth
% E is elevation
% R is image rotation (positive means clockwise)
oo = [-35 40 0]; % lh
oo = [ 35 40 0]; % rh
% after you carefully decide on your parameters,
% the code (cvn functions) need to be modified
% accordingly.
%
% the relevant functions are:
% cvnlookup.m, cvnlookupviewpoint.m, cvndefinerois.m