Home > vbmeg > functions > tool_box > atlas2vb_dir > vb_plot_brodmann_area.m

vb_plot_brodmann_area

PURPOSE ^

Plot selected brodmann atlas

SYNOPSIS ^

function vb_plot_brodmann_area(brainfile,atlasfile,Nlist,Subfig)

DESCRIPTION ^

 Plot selected brodmann atlas
  vb_plot_brodmann_area(brainfile,atlasfile)
  vb_plot_brodmann_area(brainfile,atlasfile,Nlist,Subfig)
 --- Input
 brainfile
 atlasfile
 Nlist : number of area list
         Brodmann area numbers are devided into set of area number list
         area_list = vb_get_brodmann_area_list(Nlist)
 Subfig: subplot number = [# of X-axis , # of Y-axis]

 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_brodmann_area(brainfile,atlasfile,Nlist,Subfig)
0002 % Plot selected brodmann atlas
0003 %  vb_plot_brodmann_area(brainfile,atlasfile)
0004 %  vb_plot_brodmann_area(brainfile,atlasfile,Nlist,Subfig)
0005 % --- Input
0006 % brainfile
0007 % atlasfile
0008 % Nlist : number of area list
0009 %         Brodmann area numbers are devided into set of area number list
0010 %         area_list = vb_get_brodmann_area_list(Nlist)
0011 % Subfig: subplot number = [# of X-axis , # of Y-axis]
0012 %
0013 % 2006-11-12 M. Sato
0014 %
0015 % Copyright (C) 2011, ATR All Rights Reserved.
0016 % License : New BSD License(see VBMEG_LICENSE.txt)
0017 
0018 cmap = {'r','y','c','m','b','g'};
0019 alpha_val = 1; %0.9;
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      ; % label value;
0047 xxP = Atlas.xxP; 
0048 
0049 % Color of Inflate model
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 % --- Left
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 %return
0098 %
0099 % --- Right
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

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005