@@ -400,8 +400,6 @@ class RegistrationInputSpec(ANTSCommandInputSpec):
400
400
low = 0.0 , high = 1.0 , value = 0.0 , argstr = '%s' , usedefault = True , desc = "The Lower quantile to clip image ranges" )
401
401
402
402
verbose = traits .Bool (argstr = '-v' , default = False )
403
- profiling = traits .Bool (False , usedefault = True ,
404
- desc = 'generate profiling output fields' )
405
403
406
404
407
405
class RegistrationOutputSpec (TraitedSpec ):
@@ -693,15 +691,16 @@ class Registration(ANTSCommand):
693
691
694
692
def __init__ (self , ** inputs ):
695
693
super (Registration , self ).__init__ (** inputs )
696
- self ._elapsed_time = 0.0
697
- self ._metric_value = 0.0
694
+ self ._elapsed_time = None
695
+ self ._metric_value = None
698
696
699
697
def _run_interface (self , runtime , correct_return_codes = (0 ,)):
700
698
runtime = super (Registration , self )._run_interface (runtime )
701
699
702
700
# Parse some profiling info
703
- if self .inputs .profiling :
704
- lines = runtime .stdout .split ('\n ' )
701
+ output = runtime .stdout or runtime .merged
702
+ if output :
703
+ lines = output .split ('\n ' )
705
704
for l in lines [::- 1 ]:
706
705
# This should be the last line
707
706
if l .strip ().startswith ('Total elapsed time:' ):
@@ -1063,8 +1062,9 @@ def _list_outputs(self):
1063
1062
outputs ['inverse_warped_image' ] = os .path .abspath (inv_out_filename )
1064
1063
if len (self .inputs .save_state ):
1065
1064
outputs ['save_state' ] = os .path .abspath (self .inputs .save_state )
1066
- if self .inputs . profiling :
1065
+ if self ._metric_value :
1067
1066
outputs ['metric_value' ] = self ._metric_value
1067
+ if self ._elapsed_time :
1068
1068
outputs ['elapsed_time' ] = self ._elapsed_time
1069
1069
return outputs
1070
1070
0 commit comments