@@ -795,3 +795,51 @@ def _list_outputs(self):
795
795
outputs ['output_label_image' ] = os .path .abspath (
796
796
self .inputs .output_label_image )
797
797
return outputs
798
+
799
+
800
+ class DenoiseImageInputSpec (ANTSCommandInputSpec ):
801
+ dimension = traits .Enum (2 , 3 , 4 , argstr = '-d %d' , usedefault = False ,
802
+ desc = 'This option forces the image to be treated '
803
+ 'as a specified-dimensional image. If not '
804
+ 'specified, the program tries to infer the '
805
+ 'dimensionality from the input image.' )
806
+ input_image = File (exists = True , argstr = "-i %s" ,
807
+ mandatory = True , desc = 'A scalar image is expected '
808
+ 'as input for noise correction.' )
809
+ noise_model = traits .Enum ('Gaussian' , 'Rician' , argstr = '-n %s' , usedefault = True ,
810
+ desc = ('Employ a Rician or Gaussian noise model.' ))
811
+ shrink_factor = traits .Int (default_value = 1 , usedefault = True , argstr = '-s %s' ,
812
+ desc = ('Running noise correction on large images can '
813
+ 'be time consuming. To lessen computation time, '
814
+ 'the input image can be resampled. The shrink '
815
+ 'factor, specified as a single integer, describes '
816
+ 'this resampling. Shrink factor = 1 is the default.' ))
817
+ output_image = traits .List (traits .Str (), argstr = "-o %s..." ,
818
+ desc = 'The output consists of the noise corrected '
819
+ 'version of the input image. Optionally, one '
820
+ 'can also output the estimated noise image.' )
821
+ version = traits .Bool (False , argstr = "--version" , desc = ('Get version information.' ))
822
+ verbose = traits .Bool (False , argstr = "-v" , desc = ('Verbose output.' ))
823
+ short_help = traits .Bool (False , argstr = "-h" , desc = ('Print the help menu (short version).' ))
824
+ help = traits .Bool (False , argstr = "--help" , desc = ('Print the help menu.' ))
825
+
826
+
827
+ class DenoiseImageOutputSpec (TraitedSpec ):
828
+ output_corrected_image = File (exists = True )
829
+ # TODO: optional outputs - output_noise_image
830
+
831
+
832
+ class DenoiseImage (ANTSCommand ):
833
+ """
834
+ Examples
835
+ --------
836
+
837
+ """
838
+ input_spec = DenoiseImageInputSpec
839
+ output_spec = DenoiseImageOutputSpec
840
+ _cmd = 'DenoiseImage'
841
+
842
+ def _list_outputs (self ):
843
+ outputs = self ._outputs ().get ()
844
+ outputs ['output_corrected_image' ] = os .path .abspath (self .inputs .output_image )
845
+ return outputs
0 commit comments