Skip to content

Commit f5c1229

Browse files
committed
ENH: Add initial nipype wrapping for Ants DenoiseImage
1 parent e915829 commit f5c1229

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

nipype/interfaces/ants/segmentation.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -795,3 +795,51 @@ def _list_outputs(self):
795795
outputs['output_label_image'] = os.path.abspath(
796796
self.inputs.output_label_image)
797797
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

Comments
 (0)