Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] only one el in BIDS.participants.meta #28

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Remi-Gau marked this conversation as resolved.
Show resolved Hide resolved
BIDS.participants.(char(fn)) = replace(idx);
end
end

Expand Down