Skip to content

Dcm2nii #1424

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Apr 18, 2016
Merged

Dcm2nii #1424

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions nipype/interfaces/dcm2nii.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,11 +139,13 @@ def _parse_stdout(self, stdout):
else:
output_dir = self._gen_filename('output_dir')
val = os.path.join(output_dir, val)
out_file = val
if os.path.exists(val):
out_file = val

if out_file:
files.append(out_file)
last_added_file = out_file
if not out_file in files:
files.append(out_file)
last_added_file = out_file
continue

if line.startswith("Reorienting as "):
Expand All @@ -153,9 +155,12 @@ def _parse_stdout(self, stdout):
elif line.startswith("Cropping NIfTI/Analyze image "):
base, filename = os.path.split(line[len("Cropping NIfTI/Analyze image "):])
filename = "c" + filename
reoriented_and_cropped_files.append(os.path.join(base, filename))
skip = True
continue
if os.path.exists(os.path.join(base, filename)) or self.inputs.reorient_and_crop:
# if reorient&crop is true but the file doesn't exist, this errors when setting outputs
reoriented_and_cropped_files.append(os.path.join(base, filename))
skip = True
continue

skip = False
return files, reoriented_files, reoriented_and_cropped_files, bvecs, bvals

Expand Down