code: def test_3x3_affine_bbox(affine_eye):
      """Test that the bounding-box is properly computed when \
      transforming with a negative affine component.
  
      This is specifically to test for a change in behavior between
      scipy < 0.18 and scipy >= 0.18, which is an interaction between
      offset and a diagonal affine
      """
      image = np.ones((20, 30))
      source_affine = affine_eye
      # Give the affine an offset
      source_affine[:2, 3] = np.array([96, 64])
  
      # We need to turn this data into a nibabel image
      img = Nifti1Image(image[:, :, np.newaxis], affine=source_affine)
  
      target_affine_3x3 = np.eye(3) * 2
      # One negative axes
      target_affine_3x3[1] *= -1
  
      img_3d_affine = resample_img(img, target_affine=target_affine_3x3)
  
      # If the bounding box is computed wrong, the image will be only
      # zeros
      assert_allclose(get_data(img_3d_affine).max(), image.max())
  
imports: import copy
  import math
  import os
  from pathlib import Path
  import numpy
  import pytest
  from nibabel import Nifti1Header, Nifti1Image
  from nibabel.freesurfer import MGHImage
  from numpy.testing import assert_allclose, assert_almost_equal, assert_array_almost_equal, assert_array_equal, assert_equal
  from nilearn import _utils
  from nilearn._utils import testing
  from nilearn.conftest import _affine_eye, _rng
  from nilearn.image import get_data
  from nilearn.image.image import _pad_array, crop_img
  from nilearn.image.resampling import BoundingBoxError, coord_transform, from_matrix_vector, get_bounds, reorder_img, resample_img, resample_to_img
label_desc: Use image node_id 17 for calling a global function with example usage: test_3x3_affine_bbox(affine_eye) without return types