0001 function outdata = ensemble_pathdata(indata,defs)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 outdata = ensemble_init_data_struct();
0016 outdata.type = 'paths';
0017 outdata.vars = {'subject_id','session','run','path_type','path'};
0018 pathcol = set_var_col_const(outdata.vars);
0019 outdata.data{pathcol.subject_id} = {};
0020 outdata.data{pathcol.session} = {};
0021 outdata.data{pathcol.run} = [];
0022 outdata.data{pathcol.path_type} = {};
0023 outdata.data{pathcol.path} = {};
0024
0025
0026 nsub = length(defs.sinfo);
0027 for k=1:nsub
0028 subid = defs.sinfo(k).id;
0029
0030
0031 sub_indir = fullfile(defs.paths.inroot, subid);
0032 sub_outdir = fullfile(defs.paths.outroot, subid);
0033 check_dir(sub_outdir,1);
0034
0035
0036
0037 outdata = ensemble_add_data_struct_row(outdata,'subject_id',subid,...
0038 'session',{''},'run',0,'path_type','sub_indir','path',sub_indir);
0039
0040
0041 outdata = ensemble_add_data_struct_row(outdata,'subject_id',subid,...
0042 'session',{''},'run',0,'path_type','sub_outdir','path',sub_outdir);
0043
0044 nsess = length(defs.sinfo(k).sessinfo);
0045 for is=1:nsess
0046 sessid = defs.sinfo(k).sessinfo(is).id;
0047
0048
0049 sess_indir = fullfile(sub_indir,sessid);
0050 sess_outdir = fullfile(sub_outdir,sessid);
0051 behav_indir = fullfile(sess_indir,'behavior');
0052 behav_outdir = fullfile(sess_outdir,'behavior');
0053 physio_indir = fullfile(sess_indir,'physio');
0054 physio_outdir = fullfile(sess_outdir,'physio');
0055
0056
0057 check_dir(sess_indir,1);
0058 check_dir(sess_outdir,1);
0059 check_dir(behav_indir,1);
0060 check_dir(behav_outdir,1);
0061 check_dir(physio_indir,1);
0062 check_dir(physio_outdir,1);
0063
0064
0065 outdata = ensemble_add_data_struct_row(outdata,'subject_id',subid,...
0066 'session',sessid,'run',0,'path_type','sess_indir',...
0067 'path',sess_indir);
0068 outdata = ensemble_add_data_struct_row(outdata,'subject_id',subid,...
0069 'session',sessid,'run',0,'path_type','sess_outdir',...
0070 'path',sess_outdir);
0071 outdata = ensemble_add_data_struct_row(outdata,'subject_id',subid,...
0072 'session',sessid,'run',0,'path_type','behav_indir',...
0073 'path',behav_indir);
0074 outdata = ensemble_add_data_struct_row(outdata,'subject_id',subid,...
0075 'session',sessid,'run',0,'path_type','behav_outdir',...
0076 'path',behav_outdir);
0077 outdata = ensemble_add_data_struct_row(outdata,'subject_id',subid,...
0078 'session',sessid,'run',0,'path_type','physio_indir',...
0079 'path',physio_indir);
0080 outdata = ensemble_add_data_struct_row(outdata,'subject_id',subid,...
0081 'session',sessid,'run',0,'path_type','physio_outdir',...
0082 'path',physio_outdir);
0083 end
0084 end