Skip to content
Open
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
8 changes: 7 additions & 1 deletion spm_BIDS_App.m
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,13 @@
if ~isempty(BIDS.participants)
idx = ismember(BIDS.participants.participant_id,BIDS_App.participants);
for fn=fieldnames(BIDS.participants)'
BIDS.participants.(char(fn)) = BIDS.participants.(char(fn))(idx);
replace = BIDS.participants.(char(fn));
% BIDS.participants.meta is 1x1. other fields are 1xN
if(length(replace) < length(idx))
warning('%s: idx len %d > number of values %d; ignored', char(fn), length(idx), length(replace))
continue
end
BIDS.participants.(char(fn)) = replace(idx);
end
end

Expand Down