code: def _testdata_3d_for_plotting_for_resampling(img, binary):
      """Returns testing data for resampling tests.
      Data can be binarize or not.
      """
      data = get_data(img)
      if binary:
          data[data > 0] = 1
          data[data < 0] = 0
      affine = np.array(
          [
              [1.0, -1.0, 0.0, 0.0],
              [1.0, 1.0, 0.0, 0.0],
              [0.0, 0.0, 1.0, 0.0],
              [0.0, 0.0, 0.0, 1.0],
          ]
      )
      return Nifti1Image(data, affine)
  
file_path: nilearn/nilearn/plotting/tests/test_img_plotting/test_plot_img.py
imports: import matplotlib.pyplot
  import numpy
  import pytest
  from nibabel import Nifti1Image
  from nilearn._utils.niimg import is_binary_niimg
  from nilearn.image import get_data
  from nilearn.plotting import plot_img
label_desc: Use image node_id 1 for calling a global function with example usage: _testdata_3d_for_plotting_for_resampling(img, binary) and returns: Nifti1Image