diff --git a/aa_engine/aa_doprocessing_onetask.m b/aa_engine/aa_doprocessing_onetask.m index 8831ba70f..33ca5adc9 100644 --- a/aa_engine/aa_doprocessing_onetask.m +++ b/aa_engine/aa_doprocessing_onetask.m @@ -152,6 +152,20 @@ catch aas_log(aap,true,sprintf('Could not find module in remote aap file with stage tag %s',inp.sourcestagename)); end + indexMap = aas_mapindices_betweenAAPs(aap,sourceaap); % Map remote and local aap indices + backup_deps = deps; % Take a backup of current dependencies for us to use after correct mapping. + for d = 1:numel(deps) + if strcmp(deps{d}{1},'subject') + subj_id = deps{d}{2}; + deps{d}{2} = indexMap.subject(subj_id); % find the correct subj index + end + if strcmp(deps{d}{1},'session') + subj_id = deps{d}{2}(1); + session_id = deps{d}{2}(2); + deps{d}{2}(1) = indexMap.subject(subj_id); % find the correct subj index + deps{d}{2}(2) = indexMap.session(session_id); % find the correct session index + end + end end for d = 1:numel(deps) if ~strcmp(deps{d}{1},inp.sourcedomain) ||... % only relevant modules @@ -170,6 +184,11 @@ return end + if exist('backup_deps','var') % Do we have a backup of the remote mapped dependency array? + deps = backup_deps; % Use the remote mapped dependency array if it exists + clear backup_deps % clear them after use + end + [gotinputs, streamfiles{inpind}]=aas_retrieve_inputs_part1(aap,inp,allinputs,deps); if isempty(setdiff(gotinputs,allinputs)) && inp.isessential % no new inputs found aas_log(aap,true,sprintf('No inputs obtained for stream %s!\n\tModule %s might not have created it.',inp.name,inp.sourcestagename)); diff --git a/external/XML_IO_Tools/xml_write.m b/external/XML_IO_Tools/xml_write.m index 2d7aa5e28..b6d205e5b 100644 --- a/external/XML_IO_Tools/xml_write.m +++ b/external/XML_IO_Tools/xml_write.m @@ -86,7 +86,7 @@ %% Check Matlab Version v = ver('MATLAB'); -v = str2double(regexp(v.Version, '\d.\d','match','once')); +v = str2double(regexp(v.Version, '\d+.\d+','match','once')); if (v<7) error('Your MATLAB version is too old. You need version 7.0 or newer.'); end