Home > functions > tool_box > atlas2vb_dir > vb_get_atlas_index.m

vb_get_atlas_index

PURPOSE ^

Get area index corresponding to atlas map in the given area

SYNOPSIS ^

function [ixlist,Nlist] = vb_get_atlas_index(arealist,Act)

DESCRIPTION ^

 Get area index corresponding to atlas map in the given area

 [ixlist,Nlist] = vb_get_atlas_index(arealist,Act)
 --- Input
 arealist{n}  : cell array of area name
 Act : atlas structure
 Act.xxP        :label value for each vertex [Nvertex x 1]
 Act.label      :label value;
 Act.label_name :label_name corresponding to 'label'
 --- Output
 ixlist{n} : set of area index corresponding to atlas region
 Nlist(n)  : # of points in ixlist{n}

% 2006/11/14 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    [ixlist,Nlist] = vb_get_atlas_index(arealist,Act)
0002 % Get area index corresponding to atlas map in the given area
0003 %
0004 % [ixlist,Nlist] = vb_get_atlas_index(arealist,Act)
0005 % --- Input
0006 % arealist{n}  : cell array of area name
0007 % Act : atlas structure
0008 % Act.xxP        :label value for each vertex [Nvertex x 1]
0009 % Act.label      :label value;
0010 % Act.label_name :label_name corresponding to 'label'
0011 % --- Output
0012 % ixlist{n} : set of area index corresponding to atlas region
0013 % Nlist(n)  : # of points in ixlist{n}
0014 %
0015 %% 2006/11/14 M.Sato
0016 %
0017 % Copyright (C) 2011, ATR All Rights Reserved.
0018 % License : New BSD License(see VBMEG_LICENSE.txt)
0019 
0020 xxP        = Act.xxP        ; % label value for each vertex [Nvertex x 1]
0021 label      = Act.label      ; % label value;
0022 label_name = Act.label_name ; % label_name corresponding to 'label'
0023 
0024 Narea  = length(arealist);
0025 ixlist = cell(1,Narea);
0026 Nlist  = zeros(Narea,1);
0027 
0028 for n=1:Narea
0029     % vertex index in n-th area
0030     I = strmatch(arealist{n},label_name,'exact');
0031     if isempty(I), continue; end;
0032     
0033     ix = find( xxP == label(I) );
0034     ixlist{n} = ix; 
0035     
0036     Nlist(n)  = length(ix);
0037 end

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