docstr: Workflow for applying Gibbs Ringing method.
  
  Parameters
  ----------
  input_files : string
      Path to the input volumes. This path may contain wildcards to
      process multiple inputs at once.
  slice_axis : int, optional
      Data axis corresponding to the number of acquired slices.
      Could be (0, 1, or 2): for example, a value of 2 would mean the
      third axis.
  n_points : int, optional
      Number of neighbour points to access local TV (see note).
  num_processes : int or None, optional
      Split the calculation to a pool of children processes. Only
      applies to 3D or 4D `data` arrays. Default is 1. If < 0 the maximal
      number of cores minus ``num_processes + 1`` is used (enter -1 to
      use as many cores as possible). 0 raises an error.
  out_dir : string, optional
      Output directory. (default current directory)
  out_unring : string, optional
      Name of the resulting denoised volume.
  
  References
  ----------
  .. [1] Neto Henriques, R., 2018. Advanced Methods for Diffusion MRI
  Data Analysis and their Application to the Healthy Ageing Brain
  (Doctoral thesis). https://doi.org/10.17863/CAM.29356
  
  .. [2] Kellner E, Dhital B, Kiselev VG, Reisert M. Gibbs-ringing
  artifact removal based on local subvoxel-shifts. Magn Reson Med. 2016
  doi: 10.1002/mrm.26054.
docstr_tok: ["Workflow","for","applying","Gibbs","Ringing","method",".","Parameters","--","--","--","--","--","input_files",":","string","Path","to","the","input","volumes",".","This","path","may","contain","wildcards","to","process","multiple","inputs","at","once",".","slice_axis",":","int",",","optional","Data","axis","corresponding","to","the","number","of","acquired","slices",".","Could","be","(","0",",","1",",","or","2",")",":","for","example",",","a","value","of","2","would","mean","the","third","axis",".","n_points",":","int",",","optional","Number","of","neighbour","points","to","access","local","TV","(","see","note",")",".","num_processes",":","int","or","None",",","optional","Split","the","calculation","to","a","pool","of","children","processes",".","Only","applies","to","3D","or","4D","`","data","`","arrays",".","Default","is","1",".","If","<","0","the","maximal","number","of","cores","minus","``","num_processes","+","1","``","is","used","(","enter","-1","to","use","as","many","cores","as","possible",")",".","0","raises","an","error",".","out_dir",":","string",",","optional","Output","directory",".","(","default","current","directory",")","out_unring",":","string",",","optional","Name","of","the","resulting","denoised","volume",".","References","--","--","--","--","--","..","[","1","]","Neto","Henriques",",","R.",",","2018",".","Advanced","Methods","for","Diffusion","MRI","Data","Analysis","and","their","Application","to","the","Healthy","Ageing","Brain","(","Doctoral","thesis",")",".","https",":","\/\/doi.org\/10.17863\/CAM.29356","..","[","2","]","Kellner","E",",","Dhital","B",",","Kiselev","VG",",","Reisert","M.","Gibbs-ringing","artifact","removal","based","on","local","subvoxel-shifts",".","Magn","Reson","Med",".","2016","doi",":","10.1002\/mrm.26054","."]
code: def run(
      self,
      input_files,
      slice_axis=2,
      n_points=3,
      num_processes=1,
      out_dir="",
      out_unring="dwi_unring.nii.gz",
  ):
      r"""Workflow for applying Gibbs Ringing method.
  
      Parameters
      ----------
      input_files : string
          Path to the input volumes. This path may contain wildcards to
          process multiple inputs at once.
      slice_axis : int, optional
          Data axis corresponding to the number of acquired slices.
          Could be (0, 1, or 2): for example, a value of 2 would mean the
          third axis.
      n_points : int, optional
          Number of neighbour points to access local TV (see note).
      num_processes : int or None, optional
          Split the calculation to a pool of children processes. Only
          applies to 3D or 4D `data` arrays. Default is 1. If < 0 the maximal
          number of cores minus ``num_processes + 1`` is used (enter -1 to
          use as many cores as possible). 0 raises an error.
      out_dir : string, optional
          Output directory. (default current directory)
      out_unring : string, optional
          Name of the resulting denoised volume.
  
      References
      ----------
      .. [1] Neto Henriques, R., 2018. Advanced Methods for Diffusion MRI
      Data Analysis and their Application to the Healthy Ageing Brain
      (Doctoral thesis). https://doi.org/10.17863/CAM.29356
  
      .. [2] Kellner E, Dhital B, Kiselev VG, Reisert M. Gibbs-ringing
      artifact removal based on local subvoxel-shifts. Magn Reson Med. 2016
      doi: 10.1002/mrm.26054.
  
      """
      io_it = self.get_io_iterator()
      for dwi, ounring in io_it:
          logging.info("Unringing %s", dwi)
          data, affine, image = load_nifti(dwi, return_img=True)
  
          unring_data = gibbs_removal(
              data,
              slice_axis=slice_axis,
              n_points=n_points,
              num_processes=num_processes,
          )
  
          save_nifti(ounring, unring_data, affine, image.header)
          logging.info("Denoised volume saved as %s", ounring)
  
imports: import logging
  import shutil
  import numpy
  from dipy.core.gradients import gradient_table
  from dipy.io.gradients import read_bvals_bvecs
  from dipy.io.image import load_nifti, save_nifti
  from dipy.denoise.patch2self import patch2self
  from dipy.denoise.nlmeans import nlmeans
  from dipy.denoise.localpca import localpca, mppca
  from dipy.denoise.gibbs import gibbs_removal
  from dipy.denoise.noise_estimate import estimate_sigma
  from dipy.denoise.pca_noise_estimate import pca_noise_estimate
  from dipy.workflows.workflow import Workflow
  from dipy.utils.deprecator import deprecated_params
label_desc: Use image node_id 2 for calling the GibbsRingingFlow obj's underlying member method code with example usage: obj.run(input_files, slice_axis, n_points, num_processes, out_dir, out_unring) without return types