File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,15 @@ function bidsChangeSuffix(varargin)
6363 metafiles = bids .query(BIDS , ' metafiles' , filter );
6464 end
6565
66+ if isstruct(metadata ) && isempty(fieldnames(metadata ))
67+ warning(' No metadata for filter: %s ' , createUnorderedList(filter ));
68+ end
69+
70+ if isstruct(metadata )
71+ tmp = {metadata };
72+ metadata = tmp ;
73+ end
74+
6675 for iFile = 1 : size(data , 1 )
6776
6877 specification.suffix = newSuffix ;
@@ -74,7 +83,7 @@ function bidsChangeSuffix(varargin)
7483 ' force' , force );
7584
7685 % create JSON side car
77- if ~opt .dryRun
86+ if ~opt .dryRun && ~isempty(fieldnames(metadata{ iFile }))
7887 json_file = fullfile(fileparts(data{iFile }), bf .json_filename );
7988 bids .util .jsonencode(json_file , metadata{iFile });
8089 end
You can’t perform that action at this time.
0 commit comments