@@ -98,10 +98,14 @@ class ImageMath(ANTSCommand):
98
98
input_spec = _ImageMathInputSpec
99
99
output_spec = _ImageMathOuputSpec
100
100
101
- def _list_outputs (self ):
102
- outputs = super (ImageMath , self )._list_outputs ()
101
+ def aggregate_outputs (self , runtime = None , needed_outputs = None ):
102
+ """Overload the aggregation with header replacement, if required."""
103
+ outputs = super (ImageMath , self ).aggregate_outputs (
104
+ runtime , needed_outputs )
103
105
if self .inputs .copy_header : # Fix headers
104
- _copy_header (self .inputs .op1 , outputs ["output_image" ], keep_dtype = True )
106
+ _copy_header (
107
+ self .inputs .op1 , outputs ["output_image" ], keep_dtype = True
108
+ )
105
109
return outputs
106
110
107
111
@@ -199,8 +203,10 @@ def _format_arg(self, name, trait_spec, value):
199
203
200
204
return super (ResampleImageBySpacing , self )._format_arg (name , trait_spec , value )
201
205
202
- def _list_outputs (self ):
203
- outputs = super (ResampleImageBySpacing , self )._list_outputs ()
206
+ def aggregate_outputs (self , runtime = None , needed_outputs = None ):
207
+ """Overload the aggregation with header replacement, if required."""
208
+ outputs = super (ResampleImageBySpacing , self ).aggregate_outputs (
209
+ runtime , needed_outputs )
204
210
if self .inputs .copy_header : # Fix headers
205
211
_copy_header (
206
212
self .inputs .input_image , outputs ["output_image" ], keep_dtype = True
@@ -293,8 +299,10 @@ class ThresholdImage(ANTSCommand):
293
299
input_spec = _ThresholdImageInputSpec
294
300
output_spec = _ThresholdImageOutputSpec
295
301
296
- def _list_outputs (self ):
297
- outputs = super (ThresholdImage , self )._list_outputs ()
302
+ def aggregate_outputs (self , runtime = None , needed_outputs = None ):
303
+ """Overload the aggregation with header replacement, if required."""
304
+ outputs = super (ThresholdImage , self ).aggregate_outputs (
305
+ runtime , needed_outputs )
298
306
if self .inputs .copy_header : # Fix headers
299
307
_copy_header (
300
308
self .inputs .input_image , outputs ["output_image" ], keep_dtype = True
0 commit comments