class_docstr: This class defines a padding operation:
  pad `2*border` pixels from spatial dims of the input (numpy array),
  and return the padded input.
  
  This function is used at volume level (as a preprocessor in image reader)
  therefore assumes the input has at least three spatial dims.
code: def _crop_numpy_array(image, border):
      try:
          assert (
              image.ndim >= 3
          ), "input image must have at least 3 spatial dims"
          if np.shape(border)[-1] < 2:
              # same amount cropped from each side of array
              border = np.hstack([np.array(border), np.array(border)])
  
          x_ = (
              border[0][0]
              if image.shape[0] / 2 > border[0][0] > 0
              else 0
          )
          y_ = (
              border[1][0]
              if image.shape[1] / 2 > border[1][0] > 0
              else 0
          )
          z_ = (
              border[2][0]
              if image.shape[2] / 2 > border[2][0] > 0
              else 0
          )
          _x = (
              -border[0][1]
              if image.shape[0] / 2 > border[0][1] > 0
              else image.shape[0]
          )
          _y = (
              -border[1][1]
              if image.shape[1] / 2 > border[1][1] > 0
              else image.shape[1]
          )
          _z = (
              -border[2][1]
              if image.shape[2] / 2 > border[2][1] > 0
              else image.shape[2]
          )
          return image[x_:_x, y_:_y, z_:_z, ...]
      except (IndexError, AssertionError):
          tf.logging.fatal(
              "Unable to invert the padding. Input: {}, pad param. {}".format(
                  image.shape, border
              )
          )
          raise
  
file_path: NiftyNet/niftynet/layer/pad.py
imports: from __future__ import absolute_import, print_function
  import numpy
  import tensorflow
  from niftynet.layer.base_layer import Layer, Invertible
label_desc: Use image node_id 4 for calling the PadLayer obj's underlying member method code with example usage: obj._crop_numpy_array(image, border) and returns: image