I am using bids.BIDSLayout.build_path()
to build valid BIDS-paths for images that I am saving. When I try to build a path using modified entities for a DWI image, bids.BIDSLayout.build_path()
discards the provided dir-
label.
E.g.
import bids
layout = bids.BIDSLayout('./')
dwis = layout.get(suffix='dwi', extension=['nii', 'nii.gz'])
ent = dwis[0].entities
ent.update({'acquisition': 'new'})
print(dwis[0].filename)
# 'sub-01_ses-01_dir-AP_dwi.nii.gz'
print(layout.build_path(ent))
# 'sub-01_ses-1_acq-new_dwi.nii.gz'
Do I need to use non-default path_patterns
?