0001 function vb_copy_std_atlas_area(brainfile, Nvertex)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 [std_parm, proj_root] = vb_set_icbm152(Nvertex);
0017 std_dir = fullfile(std_parm.std_dir, [std_parm.std_id, '_', num2str(std_parm.Nvertex)]);
0018 std_brain_file = fullfile(std_dir, std_parm.brain_file);
0019 std_basename = strrep(std_brain_file, '.brain.mat', '');
0020
0021
0022 tmp_area_files = dir(fullfile(std_dir, 'mni_*.area.mat'));
0023
0024
0025 std_area_files = cell(0);
0026 atlas_ids = cell(0);
0027 for k=1:length(tmp_area_files)
0028 std_area_files{k} = fullfile(std_dir, tmp_area_files(k).name);
0029 tmp = strrep(std_area_files{k}, '.area.mat', '');
0030 tmp = strrep(tmp, std_basename, '');
0031 atlas_ids{k} = tmp;
0032 end
0033
0034
0035 EXT_brain = '.brain.mat';
0036 brain_id = brainfile(1:findstr(brainfile,EXT_brain)-1);
0037
0038 for k=1:length(std_area_files)
0039 std_area_file = std_area_files{k};
0040 std_act_file = strrep(std_area_files{k}, '.area.mat', '.act.mat');
0041
0042 subj_area_file = [[brain_id, atlas_ids{k}], '.area.mat'];
0043 subj_act_file = [[brain_id, atlas_ids{k}], '.act.mat'];
0044
0045 if exist(std_area_file, 'file'), copyfile(std_area_file, subj_area_file); end
0046 if exist(std_act_file, 'file'), copyfile(std_act_file, subj_act_file); end
0047 end