We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f466cc5 commit 1c7b584Copy full SHA for 1c7b584
1 file changed
src/workflows/bidsChangeSuffix.m
@@ -63,6 +63,15 @@ function bidsChangeSuffix(varargin)
63
metafiles = bids.query(BIDS, 'metafiles', filter);
64
end
65
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
74
75
for iFile = 1:size(data, 1)
76
77
specification.suffix = newSuffix;
@@ -74,7 +83,7 @@ function bidsChangeSuffix(varargin)
83
'force', force);
84
85
% create JSON side car
- if ~opt.dryRun
86
+ if ~opt.dryRun && ~isempty(fieldnames(metadata{iFile}))
78
87
json_file = fullfile(fileparts(data{iFile}), bf.json_filename);
79
88
bids.util.jsonencode(json_file, metadata{iFile});
80
89
0 commit comments