I'm processing a BIDS dataset that passes validation with two warning (that seem unrelated). In this dataset, the fmap.hdr.IntendedFor field has 4 strings (one for each run), e.g.
K>> fmap.hdr.IntendedFor
ans =
1×4 string array
"func/sub-001_task-MGT_…" "func/sub-001_task-MGT_…" "func/sub-001_task-MGT_…" "func/sub-001_task-MGT_…"
Having a string array instead of a single string then breaks in this line of aas_processBIDS, which I think assumes a single string (the error happens in get_taskname).
|
if isfield(fmap.hdr,'IntendedFor') |
|
fmap.hdr.session = get_taskname(sesspath,subjname,fmap.hdr.IntendedFor); |
Unfortunately I don't know how IntendedFor is used. @tiborauer would it work to do something like
tmpIntendedFor = convertCharsToStrings(fmap.hdr.IntendedFor);
fmap.hdr.session = get_taskname(sesspath,subjname,tmpIntendedFor{1});
If fmap.hdr.IntendedFor is already a string array nothing is changed, and the following line works. If fmap.hdr.IntendedFor just a string (which I'm guessing is possible), then it gets turned into a string array and the following line works.
This fix works on my particular dataset but I don't want to introduce problems down the road...
I'm processing a BIDS dataset that passes validation with two warning (that seem unrelated). In this dataset, the fmap.hdr.IntendedFor field has 4 strings (one for each run), e.g.
Having a string array instead of a single string then breaks in this line of aas_processBIDS, which I think assumes a single string (the error happens in
get_taskname).automaticanalysis/aa_engine/aas_processBIDS.m
Lines 238 to 239 in ee48221
Unfortunately I don't know how IntendedFor is used. @tiborauer would it work to do something like
If
fmap.hdr.IntendedForis already a string array nothing is changed, and the following line works. Iffmap.hdr.IntendedForjust a string (which I'm guessing is possible), then it gets turned into a string array and the following line works.This fix works on my particular dataset but I don't want to introduce problems down the road...