|
257 | 257 | %-------------------------------------------------------------------------- |
258 | 258 | idx = ismember({BIDS.subjects.name},BIDS_App.participants); |
259 | 259 | BIDS.subjects = BIDS.subjects(idx); |
260 | | -idx = ismember(BIDS.participants.participant_id,BIDS_App.participants); |
261 | | -for fn=fieldnames(BIDS.participants)' |
262 | | - BIDS.participants.(char(fn)) = BIDS.participants.(char(fn))(idx); |
| 260 | +if ~isempty(BIDS.participants) |
| 261 | + idx = ismember(BIDS.participants.participant_id,BIDS_App.participants); |
| 262 | + for fn=fieldnames(BIDS.participants)' |
| 263 | + BIDS.participants.(char(fn)) = BIDS.participants.(char(fn))(idx); |
| 264 | + end |
263 | 265 | end |
264 | 266 |
|
265 | 267 | %========================================================================== |
|
274 | 276 | BIDS = BIDS_ORIG; |
275 | 277 | idx = ismember({BIDS.subjects.name},BIDS_App.participants{s}); |
276 | 278 | BIDS.subjects = BIDS.subjects(idx); |
277 | | - idx = ismember(BIDS.participants.participant_id,BIDS_App.participants{s}); |
278 | | - for fn=fieldnames(BIDS.participants)' |
279 | | - BIDS.participants.(char(fn)) = BIDS.participants.(char(fn))(idx); |
| 279 | + if ~isempty(BIDS.participants) |
| 280 | + idx = ismember(BIDS.participants.participant_id,BIDS_App.participants{s}); |
| 281 | + for fn=fieldnames(BIDS.participants)' |
| 282 | + BIDS.participants.(char(fn)) = BIDS.participants.(char(fn))(idx); |
| 283 | + end |
280 | 284 | end |
281 | 285 | spm('FnBanner',['BIDS ' upper(BIDS_App.level) ' ' BIDS_App.participants{s}]); |
282 | 286 | spm('Run',BIDS_App.config); |
|
0 commit comments