Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0953e5b

Browse files
author
Zach Lindsey
committed
convert out_files for AFNI 3dZeropad to absolute paths in list_outputs
1 parent 1506a85 commit 0953e5b

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

‎nipype/interfaces/afni/tests/test_extra_Zeropad.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from pathlib import Path
2+
from nipype import Node
23
from nipype.interfaces.afni import Zeropad
34
from nipype.testing.fixtures import create_files_in_directory
45

@@ -23,3 +24,16 @@ def test_zeropad_handles_outfile_specified_nii_gz(create_files_in_directory):
2324

2425
assert (Path(outdir) / "padded.nii.gz").exists()
2526
assert Path(result.outputs.out_file).name == "padded.nii.gz"
27+
28+
29+
def test_zeropad_keeps_file_after_node_run(create_files_in_directory):
30+
filelist, outdir = create_files_in_directory
31+
32+
zp = Node(
33+
Zeropad(I=1, out_file="padded.nii.gz"), name="test_zeropad", base_dir=outdir
34+
)
35+
zp.inputs.in_files = Path(outdir) / filelist[0]
36+
37+
result = zp.run()
38+
assert (Path(zp.output_dir()) / "padded.nii.gz").exists()
39+
assert Path(result.outputs.out_file).name == "padded.nii.gz"

‎nipype/interfaces/afni/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3502,5 +3502,4 @@ def _list_outputs(self):
35023502

35033503
if not isdefined(out_file):
35043504
out_file = "zeropad+tlrc.BRIK"
3505-
3506-
return {"out_file": out_file}
3505+
return {"out_file": op.abspath(out_file)}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /