Home > functions > tool_box > atlas2vb_dir > vb_get_atlas_label.m

vb_get_atlas_label

PURPOSE ^

Get area index corresponding to atlas map in the given area

SYNOPSIS ^

function [ix_list, ix_name] = vb_get_atlas_label(ix_area,atlasfile,atlas_id)

DESCRIPTION ^

 Get area index corresponding to atlas map in the given area

 [ix_list, ix_name] = vb_get_atlas_label(ix_area,atlasfile,atlas_id)
 --- Input
 ix_area : Vertex index for given area
 atlasfile : File name of subject atlas file (*.atlas.mat)
 atlas_id  : Atlas name ('aal', 'brodmann')
 --- Output
 ix_list : set of area index corresponding to atlas region
 ix_name : name of atlas region corresponding to 'ix_list'

% 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    [ix_list, ix_name] = vb_get_atlas_label(ix_area,atlasfile,atlas_id)
0002 % Get area index corresponding to atlas map in the given area
0003 %
0004 % [ix_list, ix_name] = vb_get_atlas_label(ix_area,atlasfile,atlas_id)
0005 % --- Input
0006 % ix_area : Vertex index for given area
0007 % atlasfile : File name of subject atlas file (*.atlas.mat)
0008 % atlas_id  : Atlas name ('aal', 'brodmann')
0009 % --- Output
0010 % ix_list : set of area index corresponding to atlas region
0011 % ix_name : name of atlas region corresponding to 'ix_list'
0012 %
0013 %% 2006/11/14 M.Sato
0014 %
0015 % Copyright (C) 2011, ATR All Rights Reserved.
0016 % License : New BSD License(see VBMEG_LICENSE.txt)
0017 
0018 % Get atlas label
0019 Act        = vb_get_act(atlasfile,atlas_id);
0020 Vlabel     = Act.xxP;
0021 label      = Act.label;
0022 label_name = Act.label_name;
0023 dd_label   = Act.dd_label;
0024 
0025 Npoint = length(Vlabel);
0026 flg    = zeros(Npoint,1);
0027 flg(ix_area) = 1;
0028 
0029 Vlabel = Vlabel.*flg;
0030 Nlabel = length(label);
0031 ix_list = [];
0032 ix_name = [];
0033 Narea   = 0;
0034 
0035 for n=1:Nlabel
0036     ix = find( Vlabel == label(n));
0037 
0038     if ~isempty(ix)
0039         Narea   = Narea + 1;
0040         ix_list{Narea} = ix;
0041         ix_name{Narea} = label_name{n};
0042     end
0043 end
0044 
0045 %return

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