Home > functions > tool_box > atlas2vb_dir > vb_plot_atlas2.m

vb_plot_atlas2

PURPOSE ^

Plot atlas region in brain

SYNOPSIS ^

function vb_plot_atlas2(brainfile,Atlas,mode)

DESCRIPTION ^

 Plot atlas region in brain
  vb_plot_atlas2(brainfile,Atlas)
  vb_plot_atlas2(brainfile,Atlas,mode)
 --- Input
 brainfile
 Atlas : structure of atlas label
 --- Optional Input
 mode = 0 : Plot Inflate-model
      = 1 : Plot real brain in 3D-space

 2006-11-12 M. Sato

 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_atlas2(brainfile,Atlas,mode)
0002 % Plot atlas region in brain
0003 %  vb_plot_atlas2(brainfile,Atlas)
0004 %  vb_plot_atlas2(brainfile,Atlas,mode)
0005 % --- Input
0006 % brainfile
0007 % Atlas : structure of atlas label
0008 % --- Optional Input
0009 % mode = 0 : Plot Inflate-model
0010 %      = 1 : Plot real brain in 3D-space
0011 %
0012 % 2006-11-12 M. Sato
0013 %
0014 % Copyright (C) 2011, ATR All Rights Reserved.
0015 % License : New BSD License(see VBMEG_LICENSE.txt)
0016 
0017 
0018 %
0019 % ---------- Plot atlas region in brain
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 %Atlas  = vb_get_act(atlasfile,atlas_id);
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 %angl = [ -90 -20; 90 -20];
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 % ---- Plot labeled region in Left brain
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 % ---- Plot labeled region in Right brain
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

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