Home > vbmeg > functions > plotfunc > subdirectory > vb_plot_head_surf.m

vb_plot_head_surf

PURPOSE ^

Plot head shape and cortex surface

SYNOPSIS ^

function vb_plot_head_surf(headfile,brainfile,plot_parm)

DESCRIPTION ^

 Plot head shape and cortex surface
  vb_plot_head_surf(headfile,brainfile)
  vb_plot_head_surf(headfile,brainfile,plot_parm)
 --- Input
 headfile{n}
 brainfile
 --- Optional Input
 plot_parm.mode = 0: overplot head on cortex
                = 1: plot head and cortex separately

 2006/10/19 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_head_surf(headfile,brainfile,plot_parm)
0002 % Plot head shape and cortex surface
0003 %  vb_plot_head_surf(headfile,brainfile)
0004 %  vb_plot_head_surf(headfile,brainfile,plot_parm)
0005 % --- Input
0006 % headfile{n}
0007 % brainfile
0008 % --- Optional Input
0009 % plot_parm.mode = 0: overplot head on cortex
0010 %                = 1: plot head and cortex separately
0011 %
0012 % 2006/10/19 M. Sato
0013 %
0014 % Copyright (C) 2011, ATR All Rights Reserved.
0015 % License : New BSD License(see VBMEG_LICENSE.txt)
0016 
0017 if ~iscell(headfile), headfile = {headfile}; end;
0018 
0019 if ~exist('plot_parm','var'), plot_parm = []; end;
0020 
0021 if ~isfield(plot_parm,'mode'),   plot_parm.mode = 0; end;
0022 if ~isfield(plot_parm,'vangle'), plot_parm.vangle = [40 25 ]; end
0023 
0024 % # of head file
0025 N = length(headfile);
0026 
0027 % # of plot
0028 if exist('brainfile','var') & ~isempty(brainfile)
0029     Nfig = N + 1;
0030 else
0031     Nfig = N;
0032 end
0033 
0034 light_mode = 0;
0035 max_mode   = 1;
0036 
0037 figure
0038 nfig = 0;
0039 
0040 if plot_parm.mode==1,
0041     if isfield(plot_parm,'NX'), 
0042         NX = plot_parm.NX;
0043     else
0044         NX = 2; 
0045     end
0046     NY   = ceil(Nfig/NX);
0047     nfig = nfig + 1;
0048     subplot(NY,NX,nfig)
0049 end
0050 
0051 %
0052 % --- Plot cortex
0053 %
0054 if exist('brainfile','var') & ~isempty(brainfile)
0055     load(brainfile,'V','F')
0056     F = F.F3;
0057 
0058     %vb_plot_surf(V,F,[],[],light_mode,max_mode)
0059     vb_plot_surf(V,F,'none','k')
0060     hold on
0061     view(plot_parm.vangle)
0062 end
0063 
0064 %
0065 % --- Plot Head
0066 %
0067 
0068 for n=1:N
0069     load(headfile{n},'Vhead','Fhead')
0070     
0071     if plot_parm.mode==1,
0072         nfig = nfig + 1;
0073         subplot(NY,NX,nfig)
0074     end
0075     
0076     vb_plot_surf(Vhead,Fhead,[],[],light_mode,max_mode)
0077     hold on
0078     view(plot_parm.vangle)
0079 end
0080 
0081 %alpha(0.5);
0082 
0083 clear Vhead Fhead V F
0084

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