code: def test_non_square_image():
      # Produce non-square 2D image
      Nori = 32
      img = np.zeros((6 * Nori, 6 * Nori))
      img[Nori : 2 * Nori, Nori : 2 * Nori] = 1
      img[2 * Nori : 3 * Nori, Nori : 3 * Nori] = 1
      img[3 * Nori : 4 * Nori, 2 * Nori : 3 * Nori] = 2
      img[4 * Nori : 5 * Nori, 3 * Nori : 5 * Nori] = 3
  
      # Corrupt image with gibbs ringing
      c = np.fft.fft2(img)
      c = np.fft.fftshift(c)
      c_crop = c[48:144, :]
      img_gibbs = abs(np.fft.ifft2(c_crop) / 2)
  
      # Produce ground truth
      Nre = 16
      img_gt = np.zeros((6 * Nre, 6 * Nori))
      img_gt[Nre : 2 * Nre, Nori : 2 * Nori] = 1
      img_gt[2 * Nre : 3 * Nre, Nori : 3 * Nori] = 1
      img_gt[3 * Nre : 4 * Nre, 2 * Nori : 3 * Nori] = 2
      img_gt[4 * Nre : 5 * Nre, 3 * Nori : 5 * Nori] = 3
  
      # Suppressing gibbs artefacts
      img_cor = gibbs_removal(img_gibbs, inplace=False)
  
      # Correction of gibbs ringing have to be closer to gt than denoised image
      diff_raw = np.mean(abs(img_gibbs - img_gt))
      diff_cor = np.mean(abs(img_cor - img_gt))
      assert_(diff_raw > diff_cor)
  
file_path: dipy/dipy/denoise/tests/test_gibbs.py
imports: import numpy
  from dipy.denoise.gibbs import _gibbs_removal_1d, _gibbs_removal_2d, gibbs_removal, _image_tv
  from numpy.testing import assert_, assert_array_almost_equal, assert_raises
label_desc: Use image node_id 12 for calling a global function with example usage: test_non_square_image() without return types