code: def test_cropping_shape(self):
      for spatial_ind in [-1, 0, 1]:
          input_param = {
              "spatial_axis": spatial_ind,
              "do_cropping": True,
          }
  
          expected_shape = (2, 14, 14, 14, 8)
          expected_value = np.zeros(expected_shape)
          self._test_nd_gradient_output_shape(
              rank=3,
              param_dict=input_param,
              expected_shape=expected_shape,
              expected_value=expected_value,
          )
  
          expected_shape = (2, 14, 14, 8)
          expected_value = np.zeros(expected_shape)
          self._test_nd_gradient_output_shape(
              rank=2,
              param_dict=input_param,
              expected_shape=expected_shape,
              expected_value=expected_value,
          )
  
file_path: NiftyNet/tests/spatial_gradient_test.py
imports: from __future__ import absolute_import, print_function
  import numpy
  import tensorflow
  from niftynet.layer.spatial_gradient import SpatialGradientLayer
  from tests.niftynet_testcase import NiftyNetTestCase
label_desc: Use image node_id 4 for calling the SpatialGradientTest obj's underlying member method code with example usage: obj.test_cropping_shape() without return types