BV original brain neighbor for specified vertex [normal_stat , index_tbl] = ... vb_cortex_normal_statics(brainfile,areafile,areakey,Rmax) --- Input brainfile areafile areakey Rmax : max radius of neighbor search In the brainfile, 'normal_stat' should be exist: normal_stat.neighbor_org : BV original brain neighbor for cortical vertex normal_stat.normal_org : BV original brain normal vector --- Output normal_stat.neighbor_org : BV original brain neighbor for specified vertex normal_stat.normal_org : BV original brain normal vector index_tbl.parent_ix = vertex index in the brain model for specified vertex index_tbl.neighbor_ix = neighbor index in the brain model for specified vertex M. Sato 2006-7-14 Copyright (C) 2011, ATR All Rights Reserved. License : New BSD License(see VBMEG_LICENSE.txt)
0001 function [normal_stat , index_tbl] = ... 0002 vb_cortex_normal_statics(brainfile,areafile,areakey,Rmax) 0003 % BV original brain neighbor for specified vertex 0004 % [normal_stat , index_tbl] = ... 0005 % vb_cortex_normal_statics(brainfile,areafile,areakey,Rmax) 0006 % --- Input 0007 % brainfile 0008 % areafile 0009 % areakey 0010 % 0011 % Rmax : max radius of neighbor search 0012 % 0013 % In the brainfile, 'normal_stat' should be exist: 0014 % normal_stat.neighbor_org : BV original brain neighbor for cortical vertex 0015 % normal_stat.normal_org : BV original brain normal vector 0016 % --- Output 0017 % normal_stat.neighbor_org : BV original brain neighbor for specified vertex 0018 % normal_stat.normal_org : BV original brain normal vector 0019 % 0020 % index_tbl.parent_ix = vertex index in the brain model for specified vertex 0021 % index_tbl.neighbor_ix = neighbor index in the brain model for specified vertex 0022 % 0023 % M. Sato 2006-7-14 0024 % 0025 % Copyright (C) 2011, ATR All Rights Reserved. 0026 % License : New BSD License(see VBMEG_LICENSE.txt) 0027 0028 % 0029 % Search neighbor points along cortex sheet 0030 % and calculate normal direction statistics 0031 % 0032 0033 % Max radius of neighbor search 0034 if ~exist('Rmax','var') | ~isempty(Rmax) 0035 Rmax = 0.004; % 6mm 0036 end 0037 0038 0039 load(brainfile, 'n*') 0040 0041 if ~exist('normal_stat','var'), 0042 error(['There is no normal_stat variable in ' brainfile]); 0043 end 0044 0045 Area = vb_get_area(areafile,areakey); 0046 Vindx = Area.Iextract; 0047 0048 fprintf('--- Make member list of brain\n') 0049 %tic 0050 root_id = vb_find_near_root(Vindx,nextIX,nextDD,Rmax); 0051 %vb_ptime(toc) 0052 0053 clear nextIX nextDD 0054 0055 index_tbl.parent_ix = Vindx; 0056 index_tbl.neighbor_ix = root_id; 0057 0058 % 0059 % --- original vertex near the cortical vertex 0060 % 0061 % normal_stat.neighbor_org : original brain neighbor index list 0062 % normal_stat.normal_org : original brain normal vector 0063 0064 % 0065 % --- Marge member list 0066 % 0067 fprintf('--- Marge member list \n') 0068 merge_id = vb_merge_member_list( root_id, normal_stat.neighbor_org ); 0069 0070 normal_stat.neighbor_org = merge_id;