Home > vbmeg > functions > common > container > vb_get_area.m

vb_get_area

PURPOSE ^

This function is used to get cortical area data.

SYNOPSIS ^

function Area_ = vb_get_area(areafile,key)

DESCRIPTION ^

 This function is used to get cortical area data. 

 --- Syntax
 Area = vb_get_area(areafile,key)

 --- Input
 areafile: Cortical area file (.area.mat)
 key     : ID of cortical area data. 

 --- Optional Input

 --- Output
 Area.Iextract: Cortical area data (set of vertex indices). 
 Area.key     : ID of this data. 

 --- Example
 >> areafile = './TY/data/TY.area.mat';
 >> key = 'Cortex';
 >> Area = vb_get_area(areafile,key);

 --- History
 2004-11-09 Taku Yoshioka
 2006-8-23 M. Sato  If area is not found, [] is returned

 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 Area_ = vb_get_area(areafile,key)
0002 % This function is used to get cortical area data.
0003 %
0004 % --- Syntax
0005 % Area = vb_get_area(areafile,key)
0006 %
0007 % --- Input
0008 % areafile: Cortical area file (.area.mat)
0009 % key     : ID of cortical area data.
0010 %
0011 % --- Optional Input
0012 %
0013 % --- Output
0014 % Area.Iextract: Cortical area data (set of vertex indices).
0015 % Area.key     : ID of this data.
0016 %
0017 % --- Example
0018 % >> areafile = './TY/data/TY.area.mat';
0019 % >> key = 'Cortex';
0020 % >> Area = vb_get_area(areafile,key);
0021 %
0022 % --- History
0023 % 2004-11-09 Taku Yoshioka
0024 % 2006-8-23 M. Sato  If area is not found, [] is returned
0025 %
0026 % Copyright (C) 2011, ATR All Rights Reserved.
0027 % License : New BSD License(see VBMEG_LICENSE.txt)
0028 
0029 if exist(areafile) ~= 2
0030   error(['Area data file ''' areafile ''' is not found.']);
0031 else
0032   load(areafile,'Area')
0033 end
0034 
0035 for i = 1:length(Area)
0036   if strcmp(Area{i}.key,key)
0037     Area_ = Area{i};
0038     return;
0039   end
0040 end
0041 
0042 Area_ = [];
0043 
0044 disp(['Area data "' key '" is not found.']);
0045 
0046 return
0047 
0048

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