-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into guiomar-patch-1
- Loading branch information
Showing
300 changed files
with
20,032 additions
and
6,907 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
function list = create_unordered_list(list) | ||
% | ||
% turns a cell string or a structure into a string | ||
% that is an unordered list to print to the screen | ||
% | ||
% USAGE:: | ||
% | ||
% list = bids.internal.create_unordered_list(list) | ||
% | ||
% :param list: obligatory argument. | ||
% :type list: cell string or structure | ||
% | ||
% | ||
|
||
% (C) Copyright 2022 Remi Gau | ||
|
||
if bids.internal.is_octave | ||
warning('off', 'Octave:mixed-string-concat'); | ||
end | ||
|
||
prefix = '\n\t- '; | ||
|
||
if ischar(list) | ||
list = cellstr(list); | ||
end | ||
|
||
if iscell(list) | ||
|
||
for i = 1:numel(list) | ||
if isnumeric(list{i}) | ||
list{i} = num2str(list{i}); | ||
end | ||
end | ||
|
||
list = sprintf([prefix, strjoin(list, prefix), '\n']); | ||
|
||
elseif isstruct(list) | ||
|
||
output = ''; | ||
fields = fieldnames(list); | ||
|
||
for i = 1:numel(fields) | ||
content = list.(fields{i}); | ||
if ~iscell(content) | ||
content = {content}; | ||
end | ||
|
||
for j = 1:numel(content) | ||
if isnumeric(content{j}) | ||
content{j} = num2str(content{j}); | ||
end | ||
end | ||
|
||
output = [output prefix fields{i} ': {' strjoin(content, ', ') '}']; | ||
end | ||
|
||
list = sprintf(output); | ||
|
||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
function pth = format_path(pth) | ||
% | ||
% USAGE:: | ||
% | ||
% pth = bids.internal.format_path(pth) | ||
% | ||
% Replaces single '\' by '/' in Windows paths | ||
% to prevent escaping warning when printing a path to screen | ||
% | ||
% :param pth: If pth is a cellstr of paths, pathToPrint will work | ||
% recursively on it. | ||
% :type pth: char or cellstr$ | ||
% | ||
% | ||
|
||
% (C) Copyright 2022 BIDS-MATLAB developers | ||
|
||
if isunix() | ||
return | ||
end | ||
|
||
if ischar(pth) | ||
pth = strrep(pth, '\', '\\'); | ||
|
||
elseif iscell(pth) | ||
for i = 1:numel(pth) | ||
pth{i} = strrep(pth{i}, '\', '\\'); | ||
end | ||
end | ||
|
||
end |
Oops, something went wrong.