Skip to content

Commit

Permalink
Update participant-specific variables for first level analyses
Browse files Browse the repository at this point in the history
  • Loading branch information
gllmflndn committed Jan 17, 2018
1 parent d8a81ff commit 3e87a07
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions spm_BIDS_App.m
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@
%--------------------------------------------------------------------------
idx = ismember({BIDS.subjects.name},BIDS_App.participants);
BIDS.subjects = BIDS.subjects(idx);
% BIDS.participants variables should also be edited
idx = ismember(BIDS.participants.participant_id,BIDS_App.participants);
for fn=fieldnames(BIDS.participants)'
BIDS.participants.(char(fn)) = BIDS.participants.(char(fn))(idx);
end

%==========================================================================
%-Analysis level: participant*
Expand All @@ -269,10 +272,14 @@

for s=1:numel(BIDS_App.participants)
BIDS = BIDS_ORIG;
BIDS.subjects = BIDS.subjects(s);
spm('FnBanner',['BIDS ' upper(BIDS_App.level) ' ' BIDS.subjects.name]);
idx = ismember({BIDS.subjects.name},BIDS_App.participants{s});
BIDS.subjects = BIDS.subjects(idx);
idx = ismember(BIDS.participants.participant_id,BIDS_App.participants{s});
for fn=fieldnames(BIDS.participants)'
BIDS.participants.(char(fn)) = BIDS.participants.(char(fn))(idx);
end
spm('FnBanner',['BIDS ' upper(BIDS_App.level) ' ' BIDS_App.participants{s}]);
spm('Run',BIDS_App.config);
BIDS = BIDS_ORIG;
end

% make sure relevant files are stored in BIDS_App.outdir
Expand All @@ -294,3 +301,4 @@
%-Delete temporary files and exit
%==========================================================================
%delete(atExit);
close all force

0 comments on commit 3e87a07

Please sign in to comment.