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 11# emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
22# vi: set ft=python sts=4 ts=4 sw=4 et:
33"""Nibabel-based interfaces."""
4- from pathlib import Path
54import numpy as np
65import nibabel as nb
76from nipype import logging
@@ -124,9 +123,8 @@ def _run_interface(self, runtime):
124123
125124 self ._results ["out_files" ] = []
126125 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 )
130128 img_3d .to_filename (out_file )
131129 self ._results ["out_files" ].append (out_file )
132130
@@ -169,7 +167,8 @@ def _run_interface(self, runtime):
169167 )
170168
171169 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 )
173172 img_4d .to_filename (out_file )
174173
175174 self ._results ["out_file" ] = out_file
You can’t perform that action at this time.
0 commit comments