Skip to content

Commit

Permalink
Add the runindex underscore only if there is a runindex (Github Issue #…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelzwiers committed May 22, 2024
1 parent 4c4560c commit c2637d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bidscoin/bids.py
Original file line number Diff line number Diff line change
Expand Up @@ -2214,7 +2214,8 @@ def addmetadata(bidsses: Path) -> None:
limitmatches(fmap, matches, limits, niifiles, scans_table)

# In the b0fieldtags, replace the limits with fieldmap runindex
newb0fieldtag = b0fieldtag.replace(':'+limits, '_'+get_bidsvalue(fmap,'run'))
runindex = get_bidsvalue(fmap, 'run')
newb0fieldtag = b0fieldtag.replace(':'+limits, '_'+runindex if runindex else '')
for niifile in niifiles:
metafile = (bidsses/niifile).with_suffix('').with_suffix('.json')
LOGGER.bcdebug(f"Updating the b0fieldtag ({b0fieldtag} -> {newb0fieldtag}) for: {metafile}")
Expand Down

0 comments on commit c2637d3

Please sign in to comment.