Skip to content

Commit 1fc518b

Browse files
authored
FIX: Merge/SplitSeries write to path of input image, instead of cwd
Addresses an oversight in #489 .
1 parent 17ed748 commit 1fc518b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

niworkflows/interfaces/nibabel.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def _run_interface(self, runtime):
125125
self._results["out_files"] = []
126126
for i, img_3d in enumerate(nb.four_to_three(img)):
127127
out_file = str(
128-
Path(fname_presuffix(in_file, suffix=f"_idx-{i:03}")).absolute()
128+
Path(fname_presuffix(in_file, suffix=f"_idx-{i:03}",
129+
newpath=runtime.cwd)).absolute()
129130
)
130131
img_3d.to_filename(out_file)
131132
self._results["out_files"].append(out_file)
@@ -169,7 +170,8 @@ def _run_interface(self, runtime):
169170
)
170171

171172
img_4d = nb.concat_images(nii_list)
172-
out_file = fname_presuffix(self.inputs.in_files[0], suffix="_merged")
173+
out_file = fname_presuffix(self.inputs.in_files[0], suffix="_merged",
174+
newpath=runtime.cwd)
173175
img_4d.to_filename(out_file)
174176

175177
self._results["out_file"] = out_file

0 commit comments

Comments
 (0)