0001 function vb_plot_brodmann_area(brainfile,atlasfile,Nlist,Subfig)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 cmap = {'r','y','c','m','b','g'};
0019 alpha_val = 1;
0020
0021 if nargin < 3, Nlist = 0; end;
0022
0023 if nargin < 4
0024 NY = 2;
0025 NX = 3;
0026 else
0027 NX = Subfig(1);
0028 NY = Subfig(2);
0029 end
0030
0031 list = vb_get_brodmann_area_list(Nlist);
0032
0033 Nfig = NX*NY;
0034
0035 [V, F, xx, inf_C] = vb_load_cortex(brainfile,'Inflate');
0036
0037 NL = F.NdipoleL;
0038 FL = F.F3L;
0039 FR = F.F3R;
0040 F = F.F3;
0041 NV = size(V,1);
0042
0043 load(atlasfile);
0044
0045 Atlas = Act{1};
0046 label = Atlas.label ;
0047 xxP = Atlas.xxP;
0048
0049
0050 colors = vb_get_inflate_color(inf_C);
0051
0052 angl = [ 10 45 ; -10 45; -60 10; 60 10; 35 20; -35 20];
0053 angl = [ 10 70 ; -10 45; -60 10; 60 10; 35 20; -35 20];
0054
0055 Lmax = max(V(1:NL,:));
0056 Lmin = min(V(1:NL,:));
0057 Rmax = max(V((NL+1):NV,:));
0058 Rmin = min(V((NL+1):NV,:));
0059
0060
0061
0062 Nlist = length(list);
0063 nfig = Nfig;
0064
0065 for n = 1:Nlist
0066 if nfig==Nfig,
0067 figure;
0068 nfig = 0;
0069 end
0070
0071 nfig = nfig + 1;
0072 nsub = 0;
0073
0074 subplot(NY,NX,nfig)
0075 patch('Faces',FL,'Vertices',V,'FaceColor','interp',...
0076 'EdgeColor','none','FaceVertexCData',colors);
0077 hold on;
0078
0079 for m = list{n}
0080 ix = find(xxP == m);
0081 if isempty(ix), continue; end;
0082 Fx = vb_patch_select2(ix,FL,NV);
0083 if isempty(Fx), continue; end
0084 nsub = nsub + 1;
0085 vb_plot_surf(V,Fx,cmap{nsub});
0086 end
0087
0088 xlim([Lmin(1) Lmax(1)]);
0089 ylim([Lmin(2) Lmax(2)]);
0090 zlim([Lmin(3) Lmax(3)]);
0091 view(angl(1,:));
0092 title(['L ' sprintf('%d ',list{n})])
0093 alpha(alpha_val)
0094
0095 end
0096
0097
0098
0099
0100
0101 nfig = Nfig;
0102
0103 for n = 1:Nlist
0104 if nfig==Nfig,
0105 figure;
0106 nfig = 0;
0107 end
0108
0109 nfig = nfig + 1;
0110 nsub = 0;
0111
0112 subplot(NY,NX,nfig)
0113 patch('Faces',FR,'Vertices',V,'FaceColor','interp',...
0114 'EdgeColor','none','FaceVertexCData',colors);
0115 hold on;
0116
0117 for m = list{n}
0118 ix = find(xxP == m + 1000);
0119 if isempty(ix), continue; end;
0120 Fx = vb_patch_select2(ix,FR,NV);
0121 if isempty(Fx), continue; end
0122 nsub = nsub + 1;
0123 vb_plot_surf(V,Fx,cmap{nsub});
0124 end
0125
0126 xlim([Rmin(1) Rmax(1)]);
0127 ylim([Rmin(2) Rmax(2)]);
0128 zlim([Rmin(3) Rmax(3)]);
0129 view(angl(1,:));
0130 title(['R ' sprintf('%d ',list{n})])
0131 alpha(alpha_val)
0132
0133
0134 end