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
2 changes: 1 addition & 1 deletion src/checkCFG.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

%% list the defaults to set

fieldsToSet.verbose = false;
fieldsToSet.verbose = 0;

fieldsToSet.useGUI = false;

Expand Down
2 changes: 1 addition & 1 deletion src/createFilename.m
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@

function talkToMe(cfg)

if cfg.verbose
if cfg.verbose > 0

fprintf(1, '\nData will be saved in this directory:\n\t%s\n', ...
fullfile(cfg.dir.outputSubject, cfg.fileName.modality));
Expand Down
9 changes: 8 additions & 1 deletion src/miss_hit.cfg
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# style guide (https://florianschanda.github.io/miss_hit/style_checker.html)
line_length: 100
regex_function_name: "[a-z]+(([A-Z]){1}[A-Za-z]+)*"
suppress_rule: "copyright_notice"
suppress_rule: "copyright_notice"

# metrics limit for the code quality (https://florianschanda.github.io/miss_hit/metrics.html)
metric "cnest": limit 4
metric "file_length": limit 500
metric "cyc": limit 15
metric "parameters": limit 6
32 changes: 19 additions & 13 deletions src/saveEventsFile.m
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,14 @@ function printHeaderExtraColumns(logFile)
warning('saveEventsFile:missingData', ...
'Missing some %s data for this event.', namesExtraColumns{iExtraColumn});

if cfg.verbose
if cfg.verbose > 1
disp(logFile(iEvent));
end

elseif ~ischar(data) && all(isnan(data))
warning('Missing %s data for this event.', namesExtraColumns{iExtraColumn});

if cfg.verbose
if cfg.verbose > 1
disp(logFile(iEvent));
end
end
Expand Down Expand Up @@ -297,11 +297,11 @@ function printHeaderExtraColumns(logFile)

else

printData(logFile(1).fileID, onset);
printData(logFile(1).fileID, duration);
printData(logFile(1).fileID, trial_type);
printData(logFile(1).fileID, onset, cfg);
printData(logFile(1).fileID, duration, cfg);
printData(logFile(1).fileID, trial_type, cfg);

printExtraColumns(logFile, iEvent);
printExtraColumns(logFile, iEvent, cfg);

fprintf(logFile(1).fileID, '\n');
fprintf(1, '\n');
Expand All @@ -311,7 +311,7 @@ function printHeaderExtraColumns(logFile)

end

function printExtraColumns(logFile, iEvent)
function printExtraColumns(logFile, iEvent, cfg)
% loops through the extra columns and print them

namesExtraColumns = returnNamesExtraColumns(logFile);
Expand All @@ -320,26 +320,32 @@ function printExtraColumns(logFile, iEvent)

data = logFile(iEvent).(namesExtraColumns{iExtraColumn});

printData(logFile(1).fileID, data);
printData(logFile(1).fileID, data, cfg);

end

end

function printData(output, data)
function printData(output, data, cfg)
% write char
% for numeric data we replace any nan by n/a
if ischar(data)
fprintf(output, '%s\t', data);
fprintf(1, '%s\t', data);
if cfg.verbose > 0
fprintf(1, '%s\t', data);
end
else
for i = 1:numel(data)
if isnan(data(i))
fprintf(output, '%s\t', 'n/a');
fprintf(1, '%s\t', 'n/a');
if cfg.verbose > 0
fprintf(1, '%s\t', 'n/a');
end
else
fprintf(output, '%f\t', data(i));
fprintf(1, '%f\t', data(i));
if cfg.verbose > 0
fprintf(1, '%f\t', data(i));
end
end
end
end
Expand Down Expand Up @@ -384,7 +390,7 @@ function errorSaveEventsFile(identifier)

function talkToMe(cfg, logFile)

if cfg.verbose
if cfg.verbose > 0

fprintf(1, '\nData were saved in this file:\n\n%s\n\n', ...
fullfile( ...
Expand Down
8 changes: 4 additions & 4 deletions src/subfun/printCreditsCppBids.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@ function printCreditsCppBids(cfg)
version = 'v1.0.0';
end

verbose = true;
verbose = 2;
if ~isempty(cfg) && isfield(cfg, 'verbose') && ~isempty(cfg.verbose)
verbose = cfg.verbose;
end

if verbose
if verbose > 1

contributors = { ...
'Rémi Gau', ...
'Marco Barilari', ...
'Ceren Battal'};

% DOI_URL = 'https://doi.org/10.5281/zenodo.3554331.';
DOI_URL = 'https://doi.org/10.5281/zenodo.4007674';

repoURL = 'https://github.com/cpp-lln-lab/CPP_BIDS';

Expand All @@ -44,7 +44,7 @@ function printCreditsCppBids(cfg)
end
fprintf('\b\n\n');

% fprintf('Please cite using the following DOI: \n %s\n\n', DOI_URL)
fprintf('Please cite using the following DOI: \n %s\n\n', DOI_URL);

fprintf('For bug report, suggestions or contributions see: \n %s\n\n', repoURL);

Expand Down
2 changes: 1 addition & 1 deletion tests/test_checkCFG.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function test_checkCfgBasic()
%% set up
outputDir = fullfile(fileparts(mfilename('fullpath')), '..', 'output');

cfg.verbose = false;
cfg.verbose = 0;

cfg.subject.subjectNb = 1;
cfg.subject.runNb = 1;
Expand Down