Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/subfun/removeAllDateSuffix.m
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions tests/test_removeDateSuffix.m
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -30,6 +31,7 @@ function test_removeDateSuffixBasic()
eventsName
stimName
stimNameZipped
stimJsonName
};

% create new files for new tests
Expand All @@ -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);

Expand All @@ -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*');
Expand Down