Skip to content

Commit 54390b2

Browse files
committed
fix: no double filenames in the list, and filenames must exist to be in the list
1 parent 4b392d5 commit 54390b2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

nipype/interfaces/dcm2nii.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,11 +139,13 @@ def _parse_stdout(self, stdout):
139139
else:
140140
output_dir = self._gen_filename('output_dir')
141141
val = os.path.join(output_dir, val)
142-
out_file = val
142+
if os.path.exists(val):
143+
out_file = val
143144

144145
if out_file:
145-
files.append(out_file)
146-
last_added_file = out_file
146+
if not out_file in files:
147+
files.append(out_file)
148+
last_added_file = out_file
147149
continue
148150

149151
if line.startswith("Reorienting as "):

0 commit comments

Comments
 (0)