Skip to content

Commit 6dac252

Browse files
committed
Bugfix to catch empty modalities when saving the bidsmap
1 parent 14d4e8b commit 6dac252

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bidscoin/bidseditor.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -745,7 +745,7 @@ def reload(self):
745745

746746
def save_bidsmap_to_file(self):
747747
"""Check and save the BIDSmap to file. """
748-
if 'fmap' in self.output_bidsmap[SOURCE]:
748+
if self.output_bidsmap[SOURCE].get('fmap'):
749749
for run in self.output_bidsmap[SOURCE]['fmap']:
750750
if not run['bids']['IntendedFor']:
751751
LOGGER.warning(f"IntendedFor fieldmap value is empty for {run['provenance']}")
@@ -1292,7 +1292,7 @@ def bidseditor(bidsfolder: str, sourcefolder: str='', bidsmapfile: str='', templ
12921292
# Obtain the initial bidsmap info
12931293
template_bidsmap, templatefile = bids.load_bidsmap(templatefile, os.path.join(bidsfolder,'code','bidscoin'))
12941294
input_bidsmap, bidsmapfile = bids.load_bidsmap(bidsmapfile, os.path.join(bidsfolder,'code','bidscoin'))
1295-
output_bidsmap = copy.deepcopy(input_bidsmap)
1295+
output_bidsmap = copy.deepcopy(input_bidsmap)
12961296

12971297
# Parse the sourcefolder from the bidsmap provenance info
12981298
if not sourcefolder:

0 commit comments

Comments
 (0)