class_docstr: An interface to denoising diffusion datasets [Coupe2008]_.
  See
  http://nipy.org/dipy/examples_built/denoise_nlmeans.html#example-denoise-nlmeans.
  
  .. [Coupe2008] Coupe P et al., `An Optimized Blockwise Non Local Means
    Denoising Filter for 3D Magnetic Resonance Images
    <https://doi.org/10.1109%2FTMI.2007.906087>`_,
    IEEE Transactions on Medical Imaging, 27(4):425-441, 2008.
  
  
  Example
  -------
  
  >>> import nipype.interfaces.dipy as dipy
  >>> denoise = dipy.Denoise()
  >>> denoise.inputs.in_file = 'diffusion.nii'
  >>> denoise.run() # doctest: +SKIP
class_docstr_tok: ["An","interface","to","denoising","diffusion","datasets","[","Coupe2008","]","_",".","See","http",":","\/\/nipy.org\/dipy\/examples_built\/denoise_nlmeans.html","#","example-denoise-nlmeans",".","..","[","Coupe2008","]","Coupe","P","et","al.",",","`","An","Optimized","Blockwise","Non","Local","Means","Denoising","Filter","for","3D","Magnetic","Resonance","Images","<","https",":","\/\/doi.org\/10.1109","%","2FTMI.2007.906087",">","`","_",",","IEEE","Transactions","on","Medical","Imaging",",","27","(","4",")",":425-441",",","2008",".","Example","--","--","--","-",">",">",">","import","nipype.interfaces.dipy","as","dipy",">",">",">","denoise","=","dipy.Denoise","(",")",">",">",">","denoise.inputs.in_file","=","'diffusion.nii'",">",">",">","denoise.run","(",")","#","doctest",":","+SKIP"]
code: def _run_interface(self, runtime):
      out_file = op.abspath(self._gen_outfilename())
  
      settings = dict(
          mask=None, rician=(self.inputs.noise_model == "rician")
      )
  
      if isdefined(self.inputs.in_mask):
          settings["mask"] = np.asanyarray(
              nb.load(self.inputs.in_mask).dataobj
          )
  
      if isdefined(self.inputs.patch_radius):
          settings["patch_radius"] = self.inputs.patch_radius
  
      if isdefined(self.inputs.block_radius):
          settings["block_radius"] = self.inputs.block_radius
  
      snr = None
      if isdefined(self.inputs.snr):
          snr = self.inputs.snr
  
      signal_mask = None
      if isdefined(self.inputs.signal_mask):
          signal_mask = np.asanyarray(
              nb.load(self.inputs.signal_mask).dataobj
          )
      noise_mask = None
      if isdefined(self.inputs.noise_mask):
          noise_mask = np.asanyarray(
              nb.load(self.inputs.noise_mask).dataobj
          )
  
      _, s = nlmeans_proxy(
          self.inputs.in_file,
          settings,
          snr=snr,
          smask=signal_mask,
          nmask=noise_mask,
          out_file=out_file,
      )
      IFLOGGER.info(
          "Denoised image saved as %s, estimated SNR=%s",
          out_file,
          str(s),
      )
      return runtime
  
imports: import os.path
  import nibabel
  import numpy
  from looseversion import LooseVersion
  from ...None import logging
  from ..base import traits, TraitedSpec, File, isdefined
  from .base import HAVE_DIPY, dipy_version, dipy_to_nipype_interface, get_dipy_workflows, DipyBaseInterface
label_desc: Use image node_id 1 for calling the Denoise obj's underlying member method code with example usage: obj._run_interface(runtime) and returns: runtime