Skip to content

Commit 644c439

Browse files
authored
Merge pull request #224 from mgxd/fix/phasediff
fix: do not load phasediff until exists
2 parents be86828 + 8f06fad commit 644c439

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

heudiconv/bids.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,8 +137,9 @@ def tuneup_bids_json_files(json_files):
137137
json_basename = '_'.join(jsonfile.split('_')[:-1])
138138
# if we got by now all needed .json files -- we can fix them up
139139
# unfortunately order of "items" is not guaranteed atm
140-
if len(glob(json_basename + '*.json')) == 3:
141-
json_phasediffname = json_basename + '_phasediff.json'
140+
json_phasediffname = json_basename + '_phasediff.json'
141+
json_mag = json_basename + '_magnitude*.json'
142+
if op.exists(json_phasediffname) and len(glob(json_mag)) >= 1:
142143
json_ = load_json(json_phasediffname)
143144
# TODO: we might want to reorder them since ATM
144145
# the one for shorter TE is the 2nd one!

0 commit comments

Comments
 (0)