0001 function vb_plot_atlas2(brainfile,Atlas,mode)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 if ~exist('mode','var'), mode=0; end
0023
0024 switch mode
0025 case 0
0026 [V, F] = vb_load_cortex(brainfile,'Inflate');
0027 case 1
0028 [V, F] = vb_load_cortex(brainfile);
0029 end
0030
0031
0032
0033 Vlabel = Atlas.xxP ;
0034 label = Atlas.label;
0035
0036 fclr = [0.8 0.7 0.6];
0037 eclr = 'none';
0038
0039 angl = [ 35 20; -35 20];
0040
0041
0042 NL = F.NdipoleL;
0043 FL = F.F3L;
0044 FR = F.F3R;
0045 NV = size(V,1);
0046
0047 Lmax = max(V(1:NL,:));
0048 Lmin = min(V(1:NL,:));
0049 Rmax = max(V((NL+1):end,:));
0050 Rmin = min(V((NL+1):end,:));
0051
0052 NX=2;
0053 NY=1;
0054
0055 figure;
0056
0057 Maxlabel = length(label);
0058
0059 cmap = vb_get_class_color(Maxlabel);
0060
0061
0062
0063 subplot(NY,NX,1);
0064
0065 ix = find( Vlabel == 0 );
0066 Fx = vb_patch_select(ix,FL,NV);
0067 vb_plot_surf(V,Fx,'w');
0068 hold on;
0069
0070 ncolor = 0;
0071
0072 for n=1:Maxlabel
0073 ix = find( Vlabel == label(n) );
0074 if ~isempty(ix)
0075 ncolor = ncolor + 1;
0076 Fx = vb_patch_select2(ix,FL,NV);
0077 vb_plot_surf(V,Fx,cmap(ncolor,:));
0078 end
0079 end
0080
0081 view(angl(1,:));
0082 title('Anatomic region in left brain')
0083
0084 xlim([Lmin(1) Lmax(1)]);
0085 ylim([Lmin(2) Lmax(2)]);
0086 zlim([Lmin(3) Lmax(3)]);
0087
0088
0089
0090
0091 subplot(NY,NX,2);
0092
0093 ix = find( Vlabel == 0 );
0094 Fx = vb_patch_select(ix,FR,NV);
0095 vb_plot_surf(V,Fx,'w');
0096 hold on;
0097
0098 ncolor = 0;
0099
0100 for n=1:Maxlabel
0101 ix = find( Vlabel == label(n) );
0102 if ~isempty(ix)
0103 ncolor = ncolor + 1;
0104 Fx = vb_patch_select2(ix,FR,NV);
0105 vb_plot_surf(V,Fx,cmap(ncolor,:));
0106 end
0107 end
0108
0109 view(angl(2,:));
0110 title('Anatomic region in right brain')
0111
0112 xlim([Rmin(1) Rmax(1)]);
0113 ylim([Rmin(2) Rmax(2)]);
0114 zlim([Rmin(3) Rmax(3)]);
0115
0116
0117 return