Home > functions > plotfunc > vb_plot_aal_atlas.m

vb_plot_aal_atlas

PURPOSE ^

SYNOPSIS ^

function vb_plot_aal_atlas(brainfile,atlasfile)

DESCRIPTION ^

 ---------- Plot 'aal'-atlas region in brain


 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function    vb_plot_aal_atlas(brainfile,atlasfile)
0002 %
0003 % ---------- Plot 'aal'-atlas region in brain
0004 %
0005 %
0006 % Copyright (C) 2011, ATR All Rights Reserved.
0007 % License : New BSD License(see VBMEG_LICENSE.txt)
0008 atlas_id = 'aal';
0009 Maxlabel = 90/2;
0010 
0011 [V, F] = vb_load_cortex(brainfile,'Inflate');
0012 %[V, F] = vb_load_cortex(brainfile);
0013 
0014 Act    = vb_get_act(atlasfile,atlas_id);
0015 Vlabel = Act.xxP  ;
0016 label  = Act.label;
0017 
0018 fclr = [0.8 0.7 0.6];
0019 eclr = 'none';
0020 
0021 angl = [ 35  20; -35  20];
0022 %angl = [ -90 -20; 90 -20];
0023 
0024 NL     = F.NdipoleL;
0025 FL     = F.F3L;
0026 FR     = F.F3R;
0027 NV   = size(V,1);
0028 
0029 Lmax = max(V(1:NL,:));
0030 Lmin = min(V(1:NL,:));
0031 Rmax = max(V((NL+1):end,:));
0032 Rmin = min(V((NL+1):end,:));
0033 
0034 NX=2;
0035 NY=1;
0036 
0037 figure;
0038 
0039 cmap = ['r';'b';'m';'c';'g';'y'];
0040 cmap = repmat(cmap, [ceil(Maxlabel/6) 1]);
0041 %
0042 % ---- Plot labeled region in Left brain
0043 %
0044 subplot(NY,NX,1);
0045 
0046 ix = find( Vlabel == 0 );
0047 Fx = vb_patch_select(ix,FL,NV);
0048 vb_plot_surf(V,Fx,'w');
0049 hold on;
0050 
0051 for n=1:Maxlabel
0052     ix = find( ((Vlabel+1)/2) == n );
0053     Fx = vb_patch_select2(ix,FL,NV);
0054     vb_plot_surf(V,Fx,cmap(n,:));
0055 %    plot3(V(ix,1),V(ix,2),V(ix,3),'.','MarkerFaceColor',cmap(n,:))
0056 end
0057 
0058 view(angl(1,:));
0059 title('Anatomic region in left brain')
0060 
0061 xlim([Lmin(1) Lmax(1)]);
0062 ylim([Lmin(2) Lmax(2)]);
0063 zlim([Lmin(3) Lmax(3)]);
0064 
0065 %
0066 % ---- Plot labeled region in Right brain
0067 %
0068 subplot(NY,NX,2);
0069 
0070 ix = find( Vlabel == 0 );
0071 Fx = vb_patch_select(ix,FR,NV);
0072 vb_plot_surf(V,Fx,'w');
0073 hold on;
0074 
0075 for n=1:Maxlabel
0076     ix = find( (Vlabel/2) == n );
0077     Fx = vb_patch_select2(ix,FR,NV);
0078     vb_plot_surf(V,Fx,cmap(n,:));
0079 %    plot3(V(ix,1),V(ix,2),V(ix,3),'.','MarkerFaceColor',cmap(n,:))
0080 end
0081 
0082 view(angl(2,:));
0083 title('Anatomic region in right brain')
0084 
0085 xlim([Rmin(1) Rmax(1)]);
0086 ylim([Rmin(2) Rmax(2)]);
0087 zlim([Rmin(3) Rmax(3)]);
0088 
0089 
0090 return
0091 %%%%%%%%%%%%%% END %%%%%%%%%%%%%%%%%%
0092 
0093 figure;
0094 
0095 
0096 %
0097 % ---- Plot unlabeled region in Left brain
0098 %
0099 subplot(NY,NX,1);
0100 
0101 vb_plot_surf(V,FL,fclr,eclr);
0102 hold on;
0103 ix = find( Vlabel == 0 );
0104 Fx = vb_patch_select(ix,FL,NV);
0105 vb_plot_surf(V,Fx,'w');
0106 
0107 view(angl(1,:));
0108 title('Anatomic region in left brain')
0109 
0110 xlim([Lmin(1) Lmax(1)]);
0111 ylim([Lmin(2) Lmax(2)]);
0112 zlim([Lmin(3) Lmax(3)]);
0113 
0114 %
0115 % ---- Plot unlabeled region in Right brain
0116 %
0117 subplot(NY,NX,2);
0118 
0119 vb_plot_surf(V,FR,fclr,eclr);
0120 hold on;
0121 ix = find( Vlabel == 0 );
0122 Fx = vb_patch_select(ix,FR,NV);
0123 vb_plot_surf(V,Fx,'w');
0124 
0125 view(angl(2,:));
0126 title('Anatomic region in right brain')
0127 
0128 xlim([Rmin(1) Rmax(1)]);
0129 ylim([Rmin(2) Rmax(2)]);
0130 zlim([Rmin(3) Rmax(3)]);

Generated on Tue 27-Aug-2013 11:46:04 by m2html © 2005