Skip to content

Camino out_file naming #1061

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 4 commits into from
Feb 23, 2015
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion nipype/algorithms/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,7 @@ def _run_interface(self, runtime):
nb.Nifti1Image(errmap.astype(np.float32), nii_ref.get_affine(),
hdr).to_filename(self._out_file)

return runtime
return runtime

def _list_outputs(self):
outputs = self.output_spec().get()
Expand Down
3 changes: 2 additions & 1 deletion nipype/algorithms/tests/test_auto_ErrorMap.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ def test_ErrorMap_inputs():
yield assert_equal, getattr(inputs.traits()[key], metakey), value

def test_ErrorMap_outputs():
output_map = dict(out_map=dict(),
output_map = dict(distance=dict(),
out_map=dict(),
)
outputs = ErrorMap.output_spec()

Expand Down
6 changes: 3 additions & 3 deletions nipype/algorithms/tests/test_errormap.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_errormap():
errmap.inputs.in_ref = os.path.join(tempdir, 'alan.nii.gz')
errmap.out_map = os.path.join(tempdir, 'out_map.nii.gz')
result = errmap.run()
yield assert_equal, result.outputs.distance, 1.125
yield assert_equal, result.outputs.distance, 1.125

# Square metric
errmap.inputs.metric = 'sqeuclidean'
Expand All @@ -42,9 +42,9 @@ def test_errormap():
# Linear metric
errmap.inputs.metric = 'euclidean'
result = errmap.run()
yield assert_equal, result.outputs.distance, 0.875
yield assert_equal, result.outputs.distance, 0.875

# Masked
# Masked
errmap.inputs.mask = os.path.join(tempdir, 'mask.nii.gz')
result = errmap.run()
yield assert_equal, result.outputs.distance, 1.0
Expand Down
2 changes: 1 addition & 1 deletion nipype/interfaces/ants/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ class Registration(ANTSCommand):
>>> outputs = reg4._list_outputs()
>>> print outputs #doctest: +ELLIPSIS
{'reverse_invert_flags': [], 'inverse_composite_transform': ['.../nipype/testing/data/output_InverseComposite.h5'], 'warped_image': '.../nipype/testing/data/output_warped_image.nii.gz', 'inverse_warped_image': <undefined>, 'forward_invert_flags': [], 'reverse_transforms': [], 'composite_transform': ['.../nipype/testing/data/output_Composite.h5'], 'forward_transforms': []}

>>> # Test collapse transforms flag
>>> reg4b = copy.deepcopy(reg4)
>>> reg4b.inputs.write_composite_transform = False
Expand Down
6 changes: 5 additions & 1 deletion nipype/interfaces/camino/dti.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,11 @@ class Track(CommandLine):

def _list_outputs(self):
outputs = self.output_spec().get()
outputs['tracked'] = os.path.abspath(self._gen_outfilename())
if isdefined(self.inputs.out_file):
out_file_path = os.path.abspath(self.inputs.out_file)
else:
out_file_path = os.path.abspath(self._gen_outfilename())
outputs['tracked'] = out_file_path
return outputs

def _gen_filename(self, name):
Expand Down
Binary file added nipype/testing/data/von-ray_errmap.nii.gz
Binary file not shown.
Binary file added nipype/testing/data/von_errmap.nii.gz
Binary file not shown.