code: def _weights(shape):
      """Computes the weights necessary to combine two images processed by
      the 1D Gibbs removal procedure along two different axes [1]_.
  
      Parameters
      ----------
      shape : tuple
          shape of the image.
  
      Returns
      -------
      G0 : 2D ndarray
          Weights for the image corrected along axis 0.
      G1 : 2D ndarray
          Weights for the image corrected along axis 1.
  
      References
      ----------
      .. [1] 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.
  
      """
      G0 = np.zeros(shape)
      G1 = np.zeros(shape)
      k0 = np.linspace(-np.pi, np.pi, num=shape[0])
      k1 = np.linspace(-np.pi, np.pi, num=shape[1])
  
      # Middle points
      K1, K0 = np.meshgrid(k1[1:-1], k0[1:-1])
      cosk0 = 1.0 + np.cos(K0)
      cosk1 = 1.0 + np.cos(K1)
      G1[1:-1, 1:-1] = cosk0 / (cosk0 + cosk1)
      G0[1:-1, 1:-1] = cosk1 / (cosk0 + cosk1)
  
      # Boundaries
      G1[1:-1, 0] = G1[1:-1, -1] = 1
      G1[0, 0] = G1[-1, -1] = G1[0, -1] = G1[-1, 0] = 1 / 2
      G0[0, 1:-1] = G0[-1, 1:-1] = 1
      G0[0, 0] = G0[-1, -1] = G0[0, -1] = G0[-1, 0] = 1 / 2
  
      return G0, G1
  
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 3 for calling a global function with example usage: _weights(shape) and returns: G0,  G1