Home > functions > plotfunc > check_model > vb_check_head_plot.m

vb_check_head_plot

PURPOSE ^

SYNOPSIS ^

function vb_check_head_plot(proj_root, head_parm, mode)

DESCRIPTION ^

 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:

SUBFUNCTIONS ^

SOURCE CODE ^

0001 function vb_check_head_plot(proj_root, head_parm, mode)
0002 %
0003 % Copyright (C) 2011, ATR All Rights Reserved.
0004 % License : New BSD License(see VBMEG_LICENSE.txt)
0005 
0006 if nargin<3, mode=0; end;
0007 
0008 % Brain & image file for plot
0009 brainfile   = head_parm.brain_file  ;
0010 analyzefile = head_parm.analyze_file;
0011 
0012 if iscell(head_parm.head_file)
0013     head_file = head_parm.head_file;
0014 else
0015     head_file = {head_parm.head_file};
0016 end
0017 
0018 Nhead  = length(head_file);
0019 
0020 % Head surface file name
0021 for n=1:Nhead
0022     headfile  = [proj_root '/' head_file{n}];
0023     if mode < 2
0024         headsave{n} = change_name(headfile, head_parm.Nvertex);
0025     else
0026         headsave{n} = headfile;
0027     end
0028 end
0029 
0030 switch    mode
0031 case    {0,2}
0032     % --- Check 3 surface on MRI
0033     vb_plot_slice_head(headsave,analyzefile,brainfile);
0034     
0035     % --- head surface
0036     vb_plot_head_surf(headsave{1}, brainfile)
0037     
0038     vangle = [40 25 ; -130 10];
0039     
0040     view(vangle(2,:))
0041     alpha(0.9);
0042     
0043 case    {1,3}
0044     for n=1:Nhead
0045         vb_plot_slice_head(headsave{n}, analyzefile, brainfile);
0046     end
0047 end
0048 
0049 if Nhead == 1, return; end;
0050 
0051 figure;
0052 
0053 if isfield(head_parm,'face_file') && ~isempty(head_parm.face_file), 
0054     load(head_parm.face_file)
0055     
0056     if exist('surf_face','var')
0057         if isfield(surf_face,'V_reduce')
0058             V = surf_face.V_reduce;
0059             F = surf_face.F_reduce;
0060         elseif isfield(surf_face,'V')
0061             V = surf_face.V;
0062             F = surf_face.F;
0063         end
0064     end
0065     
0066     vb_plot_surf(V,F,[],[],1,1);
0067     hold on
0068 end
0069 
0070 load(headsave{Nhead})
0071 vb_plot_surf(Vhead,Fhead,'none','k');
0072 alpha 0.9;
0073 
0074 return
0075 %
0076 % --- change_name
0077 %
0078 function    fnew = change_name(fold, N);
0079 
0080 fext = '.head.mat';
0081 ix_ext = findstr(fold, fext);
0082 
0083 if ~isempty(ix_ext),
0084     basename = fold(1:ix_ext-1);
0085 else
0086     basename = fold;
0087 end
0088 
0089 fnew = sprintf('%s_%d%s', basename, N, fext);

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