Home > vbmeg > functions > tool_box > atlas2vb_dir > vb_save_atlas_label.m

vb_save_atlas_label

PURPOSE ^

SYNOPSIS ^

function vb_save_atlas_label(areafile,xxP,label,key,LR)

DESCRIPTION ^

 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    vb_save_atlas_label(areafile,xxP,label,key,LR)
0002 %
0003 % Copyright (C) 2011, ATR All Rights Reserved.
0004 % License : New BSD License(see VBMEG_LICENSE.txt)
0005 
0006 %%%
0007 %%% Generate an area file with anatomical atlas division
0008 %%%
0009 
0010 if ~exist('LR','var'), LR = []; end;
0011 
0012 % Save area label into area file
0013 
0014 Nlabel = length(label);
0015 
0016 if exist(areafile,'file'),
0017   load(areafile,'MRI_ID');
0018 else
0019     [fname, MRI_ID] = vb_change_file_basename(areafile,[]);
0020 end
0021 
0022 for l = 1 : Nlabel
0023     ind = find(xxP == label(l));  %% index of region which has label(l)
0024     Area.Iextract = ind;      
0025     Area.key = [key{l} LR];
0026 
0027     if ~isempty(ind)
0028         vb_add_area(areafile, Area, MRI_ID, OFF);
0029     end
0030 end

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