Load cortical vertex coordinate & normal vector specified by area_key [V ,xx] = vb_load_cortex_area(brainfile,areafile,area_key,mode) -- Input brainfile : Brain file name --- Optional input areafile : Area file name area_key : area key mode = 0 : normal vector at the vertex = 1 : average normal vector in the neighbor of BV original brain --- Output V : cortex vertex coordinate [Nvertex, 3] xx : Normal vector to cortical surface [Nvertex, 3] Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [V ,xx] = vb_load_cortex_area(brainfile,areafile,area_key,mode) 0002 % Load cortical vertex coordinate & normal vector specified by area_key 0003 % [V ,xx] = vb_load_cortex_area(brainfile,areafile,area_key,mode) 0004 % -- Input 0005 % brainfile : Brain file name 0006 % --- Optional input 0007 % areafile : Area file name 0008 % area_key : area key 0009 % mode = 0 : normal vector at the vertex 0010 % = 1 : average normal vector in the neighbor of BV original brain 0011 % --- Output 0012 % V : cortex vertex coordinate [Nvertex, 3] 0013 % xx : Normal vector to cortical surface [Nvertex, 3] 0014 % 0015 % Copyright (C) 2011, ATR All Rights Reserved. 0016 % License : New BSD License(see VBMEG_LICENSE.txt) 0017 0018 if ~exist('mode','var'), mode = 0; end; 0019 0020 load([brainfile],'V','xx'); 0021 0022 if mode == 1, 0023 xx = vb_cortex_normal_average(brainfile); 0024 end 0025 0026 if ~exist('areafile','var') || ~exist('area_key','var'), 0027 return; 0028 end; 0029 0030 % 0031 % select area 0032 % 0033 if ~isempty(areafile) && ~isempty(area_key) 0034 Area = vb_get_area([areafile], area_key); 0035 ix = Area.Iextract; 0036 V = V(ix,:); 0037 xx = xx(ix,:); 0038 end 0039