Skip to content

Commit 736dc0f

Browse files
committed
fix: simply regenerate conversion table if heurisitic has changed
1 parent 1d82cec commit 736dc0f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

heudiconv/convert.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def prep_conversion(sid, dicoms, outdir, heuristic, converter, anon_sid,
116116
# if conversion table(s) do not exist -- we need to prepare them
117117
# (the *prepare* stage in https://github.com/nipy/heudiconv/issues/134)
118118
# if overwrite - recalculate this anyways
119-
reuse_conversion_table = op.exists(edit_file) and not overwrite
119+
reuse_conversion_table = op.exists(edit_file)
120120
# We also might need to redo it if changes in the heuristic file
121121
# detected
122122
# ref: https://github.com/nipy/heudiconv/issues/84#issuecomment-330048609
@@ -126,9 +126,9 @@ def prep_conversion(sid, dicoms, outdir, heuristic, converter, anon_sid,
126126
# 1. add a test
127127
# 2. possibly extract into a dedicated function for easier logic flow here
128128
# and a dedicated unittest
129-
if not reuse_conversion_table and \
130-
op.exists(target_heuristic_filename) and \
129+
if (op.exists(target_heuristic_filename) and
131130
file_md5sum(target_heuristic_filename) != file_md5sum(heuristic.filename):
131+
# remake conversion table
132132
reuse_conversion_table = False
133133
lgr.info(
134134
"Will not reuse existing conversion table files because heuristic "

0 commit comments

Comments
 (0)