File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
1
# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
2
2
# vi: set ft=python sts=4 ts=4 sw=4 et:
3
3
"""Nibabel-based interfaces."""
4
- from pathlib import Path
5
4
import numpy as np
6
5
import nibabel as nb
7
6
from nipype import logging
@@ -124,9 +123,8 @@ def _run_interface(self, runtime):
124
123
125
124
self ._results ["out_files" ] = []
126
125
for i , img_3d in enumerate (nb .four_to_three (img )):
127
- out_file = str (
128
- Path (fname_presuffix (in_file , suffix = f"_idx-{ i :03} " )).absolute ()
129
- )
126
+ out_file = fname_presuffix (in_file , suffix = f"_idx-{ i :03} " ,
127
+ newpath = runtime .cwd )
130
128
img_3d .to_filename (out_file )
131
129
self ._results ["out_files" ].append (out_file )
132
130
@@ -169,7 +167,8 @@ def _run_interface(self, runtime):
169
167
)
170
168
171
169
img_4d = nb .concat_images (nii_list )
172
- out_file = fname_presuffix (self .inputs .in_files [0 ], suffix = "_merged" )
170
+ out_file = fname_presuffix (self .inputs .in_files [0 ], suffix = "_merged" ,
171
+ newpath = runtime .cwd )
173
172
img_4d .to_filename (out_file )
174
173
175
174
self ._results ["out_file" ] = out_file
You can’t perform that action at this time.
0 commit comments