Skip to content

aas_processBIDS: fmap.hdr.IntendedFor #187

Description

@jpeelle

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...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions