0001 function vb_save_atlas_label(areafile,xxP,label,key,LR)
0002
0003
0004
0005
0006
0007
0008
0009
0010 if ~exist('LR','var'), LR = []; end;
0011
0012
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));
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