code: def _gibbs_removal_2d(image, n_points=3, G0=None, G1=None):
      """Suppress Gibbs ringing of a 2D image.
  
      Parameters
      ----------
      image : 2D ndarray
          Matrix containing the 2D image.
      n_points : int, optional
          Number of neighbours to access local TV (see note). Default is
          set to 3.
      G0 : 2D ndarray, optional.
          Weights for the image corrected along axis 0. If not given, the
          function estimates them using the function :func:`_weights`.
      G1 : 2D ndarray
          Weights for the image corrected along axis 1. If not given, the
          function estimates them using the function :func:`_weights`.
  
      Returns
      -------
      imagec : 2D ndarray
          Matrix with Gibbs oscillations reduced along axis a.
  
      Notes
      -----
      This function suppresses the effects of Gibbs oscillations based on the
      analysis of local total variation (TV). Although artefact correction is
      done based on two adjacent points for each voxel, total variation should be
      accessed in a larger range of neighbours. The number of neighbours to be
      considered in TV calculation can be adjusted using the parameter n_points.
  
      References
      ----------
      Please cite the following articles
      .. [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.
  
      """
      if np.any(G0) is None or np.any(G1) is None:
          G0, G1 = _weights(image.shape)
  
      img_c1 = _gibbs_removal_1d(image, axis=1, n_points=n_points)
      img_c0 = _gibbs_removal_1d(image, axis=0, n_points=n_points)
  
      C1 = _fft.fft2(img_c1)
      C0 = _fft.fft2(img_c0)
      imagec = abs(
          _fft.ifft2(_fft.fftshift(C1) * G1 + _fft.fftshift(C0) * G0)
      )
  
      return imagec
  
file_path: dipy/dipy/denoise/gibbs.py
imports: from functools import partial
  from multiprocessing import Pool
  import numpy
  import scipy
  from dipy.utils.multiproc import determine_num_processes
  from dipy.utils.deprecator import deprecated_params
  import scipy.fft
label_desc: Use image node_id 4 for calling a global function with example usage: _gibbs_removal_2d(image, n_points, G0, G1) and returns: imagec