Skip to content

Commit

Permalink
Fix getting a non-existent hardcoded dataformat ('fmap')
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelzwiers committed Sep 27, 2024
1 parent ddbce8a commit 28c3261
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bidscoin/bidseditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,9 +868,10 @@ def save_bidsmap(self):
"""Check and save the bidsmap to file"""

for dataformat in self.dataformats:
for runitem in self.output_bidsmap.dataformat(dataformat).datatype('fmap').runitems:
if not (runitem.meta.get('B0FieldSource') or runitem.meta.get('B0FieldIdentifier') or runitem.meta.get('IntendedFor')):
LOGGER.warning(f"B0FieldIdentifier/IntendedFor fieldmap value is empty for {dataformat} run-item: {runitem}")
if 'fmap' in self.output_bidsmap.dataformat(dataformat):
for runitem in self.output_bidsmap.dataformat(dataformat).datatype('fmap').runitems:
if not (runitem.meta.get('B0FieldSource') or runitem.meta.get('B0FieldIdentifier') or runitem.meta.get('IntendedFor')):
LOGGER.warning(f"B0FieldIdentifier/IntendedFor fieldmap value is empty for {dataformat} run-item: {runitem}")

filename,_ = QFileDialog.getSaveFileName(self, 'Save File', str(self.bidsfolder/'code'/'bidscoin'/'bidsmap.yaml'), 'YAML Files (*.yaml *.yml);;All Files (*)')
if filename:
Expand Down

0 comments on commit 28c3261

Please sign in to comment.