Skip to content

Commit 6fec887

Browse files
committed
Added BET's in_file conversion to relative path.
1 parent e66bc41 commit 6fec887

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

nipype/interfaces/fsl/preprocess.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,21 @@ def _run_interface(self, runtime):
165165
self.raise_exception(runtime)
166166
return runtime
167167

168+
def _format_arg(self, name, spec, value):
169+
formatted = super(BET, self)._format_arg(name, spec, value)
170+
if name == "in_file":
171+
# Convert to relative path to prevent BET failure
172+
# with long paths.
173+
return op.relpath(formatted, start=os.getcwd())
174+
return formatted
175+
168176
def _gen_outfilename(self):
169177
out_file = self.inputs.out_file
178+
# Generate default output filename if non specified.
170179
if not isdefined(out_file) and isdefined(self.inputs.in_file):
171180
out_file = self._gen_fname(self.inputs.in_file, suffix="_brain")
181+
# Convert to relative path to prevent BET failure
182+
# with long paths.
172183
return op.relpath(out_file, start=os.getcwd())
173184
return out_file
174185

0 commit comments

Comments
 (0)