Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not issue warning if cannot parse _task entity #621

Merged
merged 1 commit into from
Jan 26, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions heudiconv/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -860,7 +860,10 @@ def save_converted_files(res, item_dicoms, bids_options, outtype, prefix, outnam


def add_taskname_to_infofile(infofiles):
"""Add the "TaskName" field to json files corresponding to func images.
"""Add the "TaskName" field to json files with _task- entity in the name.

Note: _task- entity could be present not only in functional data
but in many other modalities now.

Parameters
----------
Expand All @@ -879,7 +882,8 @@ def add_taskname_to_infofile(infofiles):
op.basename(infofile))
.group(0).split('_')[0])
except AttributeError:
lgr.warning("Failed to find task field in {0}.".format(infofile))
# leave it to bids-validator to validate/inform about presence
# of required entities/fields.
continue

# write to outfile
Expand Down