Skip to content

Commit

Permalink
fix: add modality to multi-echo BIDS file name
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremie-fouquet committed Jun 25, 2024
1 parent 894eaa2 commit d4ffb49
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion brkraw/lib/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ def build_bids_json(dset, row, fname, json_path, slope=False, offset=False):
crop = [int(row.Start), int(row.End)]
else:
crop = None
fname = '{}_{}'.format(fname, row.modality)
if dset.is_multi_echo(row.ScanID, row.RecoID): # multi_echo
nii_objs = dset.get_niftiobj(row.ScanID, row.RecoID, crop=crop, slope=slope, offset=offset)
n_echo = len(nii_objs)
Expand All @@ -416,7 +417,6 @@ def build_bids_json(dset, row, fname, json_path, slope=False, offset=False):
dset.save_json(row.ScanID, row.RecoID, currentFileName, dir=row.Dir,
metadata=ref, condition=['me', echo])
else:
fname = '{}_{}'.format(fname, row.modality)
dset.save_as(row.ScanID, row.RecoID, fname, dir=row.Dir, crop=crop, slope=slope, offset=offset)
if re.search('dwi', row.modality, re.IGNORECASE):
# DTI parameter (FSL style)
Expand Down

0 comments on commit d4ffb49

Please sign in to comment.