Home > functions > plotfunc > vb_plot_cortex_surf.m

vb_plot_cortex_surf

PURPOSE ^

Plot cortical surface

SYNOPSIS ^

function [V,F] = vb_plot_cortex_surf(brainfile,LR,inflate)

DESCRIPTION ^

 Plot cortical surface
   [V,F] = vb_plot_cortex_surf(brainfile)
   [V,F] = vb_plot_cortex_surf(brainfile,LR)
   [V,F] = vb_plot_cortex_surf(brainfile,LR,inflate)
 brainfile
 LR :  'LR' for both hemishepre  [default]
       'L' for left hemisphere
       'R' for both hemisphere
 Inflate = 1 : plot Inflate brain [default]
         otherwise : plot real brain
 V : cortical vertex coordinates [Npoint x 3]
 F : patch index for cortical surface [Npatch x 3]

 Masa-aki 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    [V,F] = vb_plot_cortex_surf(brainfile,LR,inflate)
0002 % Plot cortical surface
0003 %   [V,F] = vb_plot_cortex_surf(brainfile)
0004 %   [V,F] = vb_plot_cortex_surf(brainfile,LR)
0005 %   [V,F] = vb_plot_cortex_surf(brainfile,LR,inflate)
0006 % brainfile
0007 % LR :  'LR' for both hemishepre  [default]
0008 %       'L' for left hemisphere
0009 %       'R' for both hemisphere
0010 % Inflate = 1 : plot Inflate brain [default]
0011 %         otherwise : plot real brain
0012 % V : cortical vertex coordinates [Npoint x 3]
0013 % F : patch index for cortical surface [Npatch x 3]
0014 %
0015 % Masa-aki Sato
0016 %
0017 % Copyright (C) 2011, ATR All Rights Reserved.
0018 % License : New BSD License(see VBMEG_LICENSE.txt)
0019 
0020 [NV, NL] = vb_load_cortex_info(brainfile);
0021 
0022 if ~exist('inflate','var'), inflate=1; end;
0023 if ~exist('LR','var'), LR = 'LR'; end;
0024 
0025 if inflate==1
0026     [V, F, xx, inf_C] = vb_load_cortex(brainfile,'Inflate');
0027 else
0028     [V, F]  = vb_load_cortex(brainfile);
0029 end
0030 
0031 switch    LR
0032 case    'L'
0033     F = F.F3L;
0034     Vmax = max(V(1:NL,:));
0035     Vmin = min(V(1:NL,:));
0036     ang = [-80 40];
0037 case    'R'
0038     F = F.F3R;
0039     Vmax = max(V(NL+1:NV,:));
0040     Vmin = min(V(NL+1:NV,:));
0041     ang = [80 40];
0042 otherwise
0043     F = F.F3;
0044     Vmax = max(V);
0045     Vmin = min(V);
0046     ang = [0 80];
0047 end
0048 
0049 % Ì̤òɽ¼¨
0050 if inflate==1
0051     cscale = -0.4;
0052     c0 = 0.8;
0053     colors = c0 * (inf_C * cscale + 1);
0054     colors = repmat(colors ,[1 3]);
0055     patch('Faces',F,'Vertices',V,'FaceColor','interp',...
0056         'EdgeColor','none','FaceVertexCData',colors);
0057 else
0058     fclr = [0.8 0.8 0.8];
0059     patch('Faces',F,'Vertices',V,'FaceColor',fclr,...
0060           'FaceLighting','phong','EdgeColor','none');
0061 end
0062 
0063 material dull;
0064 hold on;
0065 
0066 xlim([Vmin(1) Vmax(1)]);
0067 ylim([Vmin(2) Vmax(2)]);
0068 zlim([Vmin(3) Vmax(3)]);
0069 
0070 axis equal
0071 axis tight
0072 view(ang)

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