diff --git a/src/subfun/removeAllDateSuffix.m b/src/subfun/removeAllDateSuffix.m index be90478a..d7ddba32 100644 --- a/src/subfun/removeAllDateSuffix.m +++ b/src/subfun/removeAllDateSuffix.m @@ -27,6 +27,10 @@ function removeAllDateSuffix(rawDir, subjName, sesName) end % do stim + filenames = file_utils('List', subjectPath, ... + sprintf('^%s.*_task-.*_stim_date-.*json$', subjName)); + removeDateSuffix(filenames, subjectPath); + filenames = file_utils('List', subjectPath, ... sprintf('^%s.*_task-.*_stim_date-.*tsv$', subjName)); compressFiles(filenames, subjectPath); diff --git a/tests/test_removeDateSuffix.m b/tests/test_removeDateSuffix.m index e1d85d6b..edb360af 100644 --- a/tests/test_removeDateSuffix.m +++ b/tests/test_removeDateSuffix.m @@ -21,6 +21,7 @@ function test_removeDateSuffixBasic() eventsName = 'test_events_date-202008050730.tsv'; stimName = 'test_stim_date-202008050730.tsv'; stimNameZipped = 'test2_stim_date-202008050730.tsv.gz'; + stimJsonName = 'test_stim_date-202008050730.json'; filesToProcess = { ... boldName @@ -30,6 +31,7 @@ function test_removeDateSuffixBasic() eventsName stimName stimNameZipped + stimJsonName }; % create new files for new tests @@ -48,6 +50,7 @@ function test_removeDateSuffixBasic() expectedEventsName = 'test_events.tsv'; expectedStimName = 'test_stim.tsv'; expectedStimNameZipped = 'test2_stim.tsv.gz'; + expectedStimJson = 'test_stim.json'; removeDateSuffix(filenames, outputDir); @@ -61,6 +64,7 @@ function test_removeDateSuffixBasic() assertEqual(exist(fullfile(outputDir, expectedStimNameZipped), 'file'), 2); assertEqual(exist(fullfile(outputDir, expectedBoldName2), 'file'), 2); assertEqual(exist(fullfile(outputDir, expectedBoldName), 'file'), 2); + assertEqual(exist(fullfile(outputDir, expectedStimJson), 'file'), 2); % clean up delete('*.nii*');