0001 function [V,F] = vb_plot_cortex_surf(brainfile,LR,inflate)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 [NV, NL] = vb_load_cortex_info(brainfile);
0021
0022 if ~exist('inflate','var'), inflate=1; end;
0023 if ~exist('LR','var'), LR = 'LR'; end;
0024
0025 if inflate==1
0026 [V, F, xx, inf_C] = vb_load_cortex(brainfile,'Inflate');
0027 else
0028 [V, F] = vb_load_cortex(brainfile);
0029 end
0030
0031 switch LR
0032 case 'L'
0033 F = F.F3L;
0034 Vmax = max(V(1:NL,:));
0035 Vmin = min(V(1:NL,:));
0036 ang = [-80 40];
0037 case 'R'
0038 F = F.F3R;
0039 Vmax = max(V(NL+1:NV,:));
0040 Vmin = min(V(NL+1:NV,:));
0041 ang = [80 40];
0042 otherwise
0043 F = F.F3;
0044 Vmax = max(V);
0045 Vmin = min(V);
0046 ang = [0 80];
0047 end
0048
0049
0050 if inflate==1
0051 cscale = -0.4;
0052 c0 = 0.8;
0053 colors = c0 * (inf_C * cscale + 1);
0054 colors = repmat(colors ,[1 3]);
0055 patch('Faces',F,'Vertices',V,'FaceColor','interp',...
0056 'EdgeColor','none','FaceVertexCData',colors);
0057 else
0058 fclr = [0.8 0.8 0.8];
0059 patch('Faces',F,'Vertices',V,'FaceColor',fclr,...
0060 'FaceLighting','phong','EdgeColor','none');
0061 end
0062
0063 material dull;
0064 hold on;
0065
0066 xlim([Vmin(1) Vmax(1)]);
0067 ylim([Vmin(2) Vmax(2)]);
0068 zlim([Vmin(3) Vmax(3)]);
0069
0070 axis equal
0071 axis tight
0072 view(ang)