0001 function [] = hide_files(fi)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 nsub = length(fi.sub_id);
0014
0015 for isub = 1:nsub
0016 disp(sprintf('Moving files for subject %s', fi.sub_id{isub}))
0017 subpath = fullfile(fi.rootdir,fi.sub_id{isub});
0018
0019 for irun = 1:length(fi.vol_info(isub).run_id)
0020 run_idx = fi.vol_info(isub).run_id(irun);
0021 disp(sprintf(' Run %d', run_idx))
0022
0023 srcdir = fullfile(subpath,sprintf('epi/run%d',run_idx));
0024 destdir = fullfile(subpath,sprintf('epi/run%d',run_idx),fi.destdir);
0025
0026 if ~exist(destdir,'dir')
0027 disp(sprintf('Creating directory: %s', destdir))
0028 unix(['mkdir ' destdir]);
0029 end
0030
0031 nvol = length(fi.vol_info(isub).vol_id{irun});
0032 for ivol = 1:nvol
0033 vol_idx = fi.vol_info(isub).vol_id{irun}(ivol);
0034
0035 for ipre = 1:length(fi.prestr)
0036 unix_str = sprintf('mv %s/%s%s*i%04d.* %s', srcdir, fi.prestr{ipre},fi.sub_id{isub}, vol_idx, destdir);
0037 unix(unix_str);
0038 end
0039 end
0040 end
0041 end