From 7ae2ed6353c22428ca20e780d3c53c9e055fdec5 Mon Sep 17 00:00:00 2001 From: WillForan Date: Sat, 28 Oct 2023 20:13:55 -0400 Subject: [PATCH 1/2] [BUG] only one el in BIDS.participants.meta --- spm_BIDS_App.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spm_BIDS_App.m b/spm_BIDS_App.m index f5af1bc..6665588 100644 --- a/spm_BIDS_App.m +++ b/spm_BIDS_App.m @@ -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 From 7800afbc6298cd413a9938d6a56c105f789f99b7 Mon Sep 17 00:00:00 2001 From: Remi Gau Date: Wed, 8 Nov 2023 13:38:37 +0100 Subject: [PATCH 2/2] Update spm_BIDS_App.m --- spm_BIDS_App.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spm_BIDS_App.m b/spm_BIDS_App.m index 6665588..c59bc14 100644 --- a/spm_BIDS_App.m +++ b/spm_BIDS_App.m @@ -265,7 +265,7 @@ if(length(replace) < length(idx)) warning('%s: idx len %d > number of values %d; ignored', char(fn), length(idx), length(replace)) continue - end + end BIDS.participants.(char(fn)) = replace(idx); end end