Skip to content

Commit 6620234

Browse files
committed
fix: dcm2nii does not always crop and reorient when it says it does
1 parent e5674fe commit 6620234

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
@@ -155,9 +155,11 @@ def _parse_stdout(self, stdout):
155155
elif line.startswith("Cropping NIfTI/Analyze image "):
156156
base, filename = os.path.split(line[len("Cropping NIfTI/Analyze image "):])
157157
filename = "c" + filename
158-
reoriented_and_cropped_files.append(os.path.join(base, filename))
159-
skip = True
160-
continue
158+
if os.path.exists(os.path.join(base, filename)):
159+
reoriented_and_cropped_files.append(os.path.join(base, filename))
160+
skip = True
161+
continue
162+
161163
skip = False
162164
return files, reoriented_files, reoriented_and_cropped_files, bvecs, bvals
163165

0 commit comments

Comments
 (0)