class_docstr: This class defines a cropping operation:
  Removing ``2*border`` pixels from each spatial dim of the input,
  and return the spatially centred elements extracted from the input.
code: def layer_op(self, inputs):
      spatial_rank = layer_util.infer_spatial_rank(inputs)
      offsets = [0] + [int(self.border)] * spatial_rank + [0]
      # inferring the shape of the output by subtracting the border dimension
      out_shape = [
          int(d) - 2 * int(self.border)
          for d in list(inputs.shape)[1:-1]
      ]
      out_shape = [-1] + out_shape + [-1]
      output_tensor = tf.slice(inputs, offsets, out_shape)
      return output_tensor
  
file_path: NiftyNet/niftynet/layer/crop.py
imports: from __future__ import absolute_import, print_function
  import tensorflow
  from niftynet.layer import layer_util
  from niftynet.layer.base_layer import Layer
label_desc: Use image node_id 2 for calling the CropLayer obj's underlying member method code with example usage: obj.layer_op(inputs) and returns: output_tensor