Skip to content

Commit ca52d94

Browse files
committed
made check for ".aff not found" to raise error so that it doesn't fail silently
1 parent 898db0c commit ca52d94

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

nipype/interfaces/dtitk/registration.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,8 @@ class RigidInputSpec(CommandLineInputSpec):
4646
ftol = traits.Float(mandatory=True, position=4, argstr="%g",
4747
desc="cost function tolerance", default_value=0.01,
4848
usedefault=True)
49-
# use_in_trans = traits.Bool(position=5, argstr="1",
50-
# desc="initialize with existing transform")
5149
initialize_xfm = File(desc="DTITK-FORMAT transform ",
5250
copyfile=False, position=5, argstr="%s")
53-
# need to enforce DTITK format or it's a silent failure
54-
# (can we search the stderr for keywords to error if not found?)
55-
# stderr: filename.aff doesn't exist or can't be opened
5651

5752

5853
class RigidOutputSpec(TraitedSpec):
@@ -86,6 +81,12 @@ class Rigid(CommandLineDtitk):
8681
value = 1
8782
return super(Rigid, self)._format_arg(name, spec, value)'''
8883

84+
def _run_interface(self, runtime):
85+
runtime = super(Rigid, self)._run_interface(runtime)
86+
if '''.aff doesn't exist or can't be opened''' in runtime.stderr:
87+
self.raise_exception(runtime)
88+
return runtime
89+
8990
def _list_outputs(self):
9091
outputs = self.output_spec().get()
9192
moving = self.inputs.moving_file

0 commit comments

Comments
 (0)