Skip to content

Commit 2fc70ca

Browse files
committed
mh autofix
1 parent d6dd167 commit 2fc70ca

21 files changed

+325
-332
lines changed

checkCFG.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
if nargin < 1 || isempty(cfg)
88
cfg = struct();
99
end
10-
10+
1111
checkCppBidsDependencies(cfg);
1212

1313
%% list the defaults to set

checkCppBidsDependencies.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function checkCppBidsDependencies(cfg)
22
% checkCppBidsDependencies()
33
%
4-
4+
55
pth = fileparts(mfilename('fullpath'));
66

77
checkSubmodule(fullfile(pth, 'lib', 'JSONio'));

convertSourceToRaw.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function convertSourceToRaw(cfg)
66
% - creates dummy README and CHANGE file
77
% - copy source dir to raw dir
88
% - remove the date suffix (_date-YYYYMMDDHHMM) from the files where it is present
9-
%
9+
%
1010

1111
sourceDir = fullfile(cfg.dir.output, 'source');
1212
rawDir = fullfile(cfg.dir.output, 'rawdata');

createFilename.m

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -11,34 +11,34 @@
1111
%
1212
%
1313
% See test_createFilename in the test folder for more details on how to use it.
14-
14+
1515
cfg = checkCFG(cfg);
16-
16+
1717
cfg.fileName.pattern = ['%0' num2str(cfg.fileName.zeroPadding) '.0f'];
1818
cfg.fileName.date = datestr(now, cfg.fileName.dateFormat);
19-
19+
2020
if ~isfield(cfg, 'task')
2121
error('createFilename: missing a task name. i.e cfg.task.name');
2222
end
23-
23+
2424
cfg = getModality(cfg);
25-
25+
2626
cfg = createDirectories(cfg);
27-
27+
2828
cfg = setSuffixes(cfg);
29-
29+
3030
cfg = setFilenames(cfg);
31-
31+
3232
talkToMe(cfg);
33-
33+
3434
cfg = orderfields(cfg);
3535
cfg.fileName = orderfields(cfg.fileName);
3636
cfg.dir = orderfields(cfg.dir);
37-
37+
3838
end
3939

4040
function cfg = getModality(cfg)
41-
41+
4242
switch lower(cfg.testingDevice)
4343
case 'pc'
4444
modality = 'beh';
@@ -53,52 +53,52 @@
5353
otherwise
5454
modality = 'beh';
5555
end
56-
56+
5757
cfg.fileName.modality = modality;
58-
58+
5959
end
6060

6161
function [subjectGrp, subjectNb, sessionNb, modality, taskName] = extractInput(cfg)
62-
62+
6363
subjectGrp = cfg.subject.subjectGrp;
6464
subjectNb = cfg.subject.subjectNb;
6565
sessionNb = cfg.subject.sessionNb;
6666
modality = cfg.fileName.modality;
6767
taskName = cfg.fileName.task;
68-
68+
6969
if isempty(sessionNb)
7070
sessionNb = 1;
7171
end
72-
72+
7373
end
7474

7575
function cfg = createDirectories(cfg)
76-
76+
7777
[subjectGrp, subjectNb, sessionNb, modality] = extractInput(cfg);
78-
78+
7979
pattern = cfg.fileName.pattern;
80-
80+
8181
% output dir
8282
cfg.dir.outputSubject = fullfile ( ...
8383
cfg.dir.output, ...
8484
'source', ...
8585
['sub-' subjectGrp, sprintf(pattern, subjectNb)], ...
8686
['ses-', sprintf(pattern, sessionNb)]);
87-
87+
8888
[~, ~, ~] = mkdir(cfg.dir.output);
8989
[~, ~, ~] = mkdir(cfg.dir.outputSubject);
9090
[~, ~, ~] = mkdir(fullfile(cfg.dir.outputSubject, modality));
91-
91+
9292
if cfg.eyeTracker.do
9393
[~, ~, ~] = mkdir(fullfile(cfg.dir.outputSubject, 'eyetracker'));
9494
end
95-
95+
9696
end
9797

9898
function cfg = setSuffixes(cfg)
99-
99+
100100
cfg.fileName.suffix.run = ['_run-' sprintf(cfg.fileName.pattern, cfg.subject.runNb)];
101-
101+
102102
% set values for the suffixes for the different fields in the BIDS name
103103
fields2Check = { ...
104104
'contrastEnhancement', ...
@@ -107,7 +107,7 @@
107107
'echo', ...
108108
'acquisition'
109109
};
110-
110+
111111
for iField = 1:numel(fields2Check)
112112
if isempty (cfg.mri.(fields2Check{iField})) %#ok<*GFLD>
113113
cfg.fileName.suffix.mri.(fields2Check{iField}) = ''; %#ok<*SFLD>
@@ -116,85 +116,85 @@
116116
['_' fields2Check{iField} '-' getfield(cfg.mri, fields2Check{iField})];
117117
end
118118
end
119-
119+
120120
cfg.fileName.suffix = orderfields(cfg.fileName.suffix);
121-
121+
122122
end
123123

124124
function cfg = setFilenames(cfg)
125-
125+
126126
[subjectGrp, subjectNb, sessionNb, modality, taskName] = extractInput(cfg);
127-
127+
128128
pattern = cfg.fileName.pattern;
129-
129+
130130
runSuffix = cfg.fileName.suffix.run;
131131
acqSuffix = cfg.fileName.suffix.mri.acquisition ;
132132
ceSuffix = cfg.fileName.suffix.mri.contrastEnhancement ;
133133
dirSuffix = cfg.fileName.suffix.mri.phaseEncodingDirection ;
134134
recSuffix = cfg.fileName.suffix.mri.reconstruction ;
135135
echoSuffix = cfg.fileName.suffix.mri.echo;
136-
136+
137137
thisDate = cfg.fileName.date;
138-
138+
139139
cfg.fileName.datasetDescription = fullfile ( ...
140140
cfg.dir.output, ...
141141
'dataset_description.json');
142-
142+
143143
% create base fileName
144144
fileNameBase = ...
145145
['sub-', subjectGrp, sprintf(pattern, subjectNb), ...
146146
'_ses-', sprintf(pattern, sessionNb), ...
147147
'_task-', taskName];
148148
cfg.fileName.base = fileNameBase;
149-
149+
150150
switch modality
151-
151+
152152
case 'func'
153-
153+
154154
cfg.fileName.events = ...
155155
[fileNameBase, ...
156156
acqSuffix, ceSuffix, ...
157157
dirSuffix, recSuffix, ...
158158
runSuffix, echoSuffix, ...
159159
'_events_date-' thisDate '.tsv'];
160-
160+
161161
otherwise
162-
162+
163163
cfg.fileName.events = ...
164164
[fileNameBase, runSuffix, '_events_date-' thisDate '.tsv'];
165-
165+
166166
end
167-
167+
168168
cfg.fileName.stim = strrep(cfg.fileName.events, 'events', 'stim');
169-
169+
170170
if cfg.eyeTracker.do
171171
cfg.fileName.eyetracker = ...
172172
[fileNameBase, acqSuffix, ...
173173
runSuffix, '_eyetrack_date-' thisDate '.edf'];
174174
end
175-
175+
176176
end
177177

178178
function talkToMe(cfg)
179-
179+
180180
if cfg.verbose
181-
181+
182182
fprintf(1, '\nData will be saved in this directory:\n\t%s\n', ...
183183
fullfile(cfg.dir.outputSubject, cfg.fileName.modality));
184-
184+
185185
fprintf(1, '\nData will be saved in this file:\n\t%s\n', ...
186186
cfg.fileName.events);
187-
187+
188188
if cfg.eyeTracker.do
189-
189+
190190
fprintf(1, '\nEyetracking data will be saved in this directory:\n\t%s\n', ...
191191
fullfile(cfg.dir.outputSubject, 'eyetracker'));
192-
192+
193193
fprintf(1, '\nEyetracking data will be saved in this file:\n\t%s\n', ...
194194
cfg.fileName.eyetracker);
195-
195+
196196
end
197-
197+
198198
end
199-
199+
200200
end

printCreditsCppBids.m

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
function printCreditsCppBids(cfg)
2-
2+
33
verbose = true;
44
if ~isempty(cfg) && isfield(cfg, 'verbose') && ~isempty(cfg.verbose)
55
verbose = cfg.verbose;
66
end
7-
7+
88
if verbose
9-
9+
1010
version = '0.0.1';
11-
11+
1212
contributors = { ...
1313
'Rémi Gau', ...
1414
'Marco Barilari', ...
1515
'Ceren Battal'};
16-
16+
1717
% DOI_URL = 'https://doi.org/10.5281/zenodo.3554331.';
18-
18+
1919
repoURL = 'https://github.com/cpp-lln-lab/CPP_BIDS';
20-
20+
2121
fprintf('\n\n');
22-
22+
2323
disp('___________________________________________________');
2424
disp('___________________________________________________');
2525
disp(' ');
@@ -28,26 +28,26 @@ function printCreditsCppBids(cfg)
2828
disp(' | (__| _/ _/ | _ \| || |) \__ \');
2929
disp(' \___|_| |_| |___/___|___/|___/');
3030
disp(' ');
31-
31+
3232
splash = 'Thank you for using the CPP BIDS - version %s. ';
3333
fprintf(splash, version);
3434
fprintf('\n\n');
35-
35+
3636
fprintf('Current list of contributors includes:\n');
3737
for iCont = 1:numel(contributors)
3838
fprintf(' %s\n', contributors{iCont});
3939
end
4040
fprintf('\b\n\n');
41-
41+
4242
% fprintf('Please cite using the following DOI: \n %s\n\n', DOI_URL)
43-
43+
4444
fprintf('For bug report, suggestions or contributions see: \n %s\n\n', repoURL);
45-
45+
4646
disp('___________________________________________________');
4747
disp('___________________________________________________');
48-
48+
4949
fprintf('\n\n');
50-
50+
5151
end
52-
52+
5353
end

0 commit comments

Comments
 (0)