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
27 changes: 13 additions & 14 deletions src/utils/removeAllDateSuffix.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,25 @@

function removeAllDateSuffix(rawDir, subjName, sesName)
%
% Short description of what the function does goes here.
% Function removes the date suffix in the _events and _stim (.tsv and .json)
% files in given raw, session and subject folder. And zips the _stim files.
% Function will look for files with suffix of ``_date-*``
%
% USAGE::
%
% [argout1, argout2] = templateFunction(argin1, [argin2 == default,] [argin3])
% removeAllDateSuffix(rawDir, subjName, sesName)
%
% :param argin1: (dimension) obligatory argument. Lorem ipsum dolor sit amet,
% consectetur adipiscing elit. Ut congue nec est ac lacinia.
% :type argin1: type
% :param argin2: optional argument and its default value. And some of the
% options can be shown in litteral like ``this`` or ``that``.
% :type argin2: string
% :param argin3: (dimension) optional argument
% :type argin3: integer
% :param rawDir: BIDS raw folder directory.
% :type rawDir: string
%
% :returns: - :argout1: (type) (dimension)
% - :argout2: (type) (dimension)
%
% removeAllDateSuffix(rawDir, subjName, sesName)
% :param subjName: Some of the options can be ``sub-001`` or ``sub-pilot001``.
% :type subjName: string
%
% :param sesName: Some of the options can be ``ses-001`` or ``ses-003``.
% :type sesName: string

% :output: - files are renamed by removing '_date-*' suffix
% and _stim files are zipped

labels = {'func', 'bold', 'eeg', 'ieeg', 'meg', 'beh'};

Expand Down
24 changes: 9 additions & 15 deletions src/utils/removeDateSuffix.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,21 @@

function removeDateSuffix(filenames, subjectPath)
%
% Short description of what the function does goes here.
% Function removes the date suffix in a given filename(s)
% Function will look for regular expression in filenames with ``_date-``

%
% USAGE::
%
% [argout1, argout2] = templateFunction(argin1, [argin2 == default,] [argin3])
%
% :param argin1: (dimension) obligatory argument. Lorem ipsum dolor sit amet,
% consectetur adipiscing elit. Ut congue nec est ac lacinia.
% :type argin1: type
% :param argin2: optional argument and its default value. And some of the
% options can be shown in litteral like ``this`` or ``that``.
% :type argin2: string
% :param argin3: (dimension) optional argument
% :type argin3: integer
%
% :returns: - :argout1: (type) (dimension)
% - :argout2: (type) (dimension)
% removeDateSuffix(filenames, subjectPath)
%
% removeDateSuffix(filenames, subjectPath)
% :param filenames: File names with _date- suffix
% :type filenames: string
%
% :param subjectPath: Location/path of the files
% :type subjectPath: string
%
% :output: - files are renamed by removing '_date-*' suffix

if isempty(filenames)
filenames = {};
Expand Down