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.
docstr: :param image_name: the name of the relevant key in the data dictionary
  :param border: the dimensions of the desired border around the image.
  :param name: name of the PadLayer in the tensorflow graph.
  :param mode: how to choose the padding values for the np.pad operation.
  :param pad_to: this determines a desired size of the padded image (useful
      for inconsistent input sizes or for making inference efficient). If
      it == (0, ) (DEFAULT), it will use the constant padding mode
      determined by 'border'
code: def __init__(
      self, image_name, border, name="pad", mode="minimum", pad_to=(0,)
  ):
      """
      :param image_name: the name of the relevant key in the data dictionary
      :param border: the dimensions of the desired border around the image.
      :param name: name of the PadLayer in the tensorflow graph.
      :param mode: how to choose the padding values for the np.pad operation.
      :param pad_to: this determines a desired size of the padded image (useful
          for inconsistent input sizes or for making inference efficient). If
          it == (0, ) (DEFAULT), it will use the constant padding mode
          determined by 'border'
      """
      super(PadLayer, self).__init__(name=name)
      try:
          spatial_border = tuple(map(lambda x: (x,), border))
      except (ValueError, TypeError):
          tf.logging.fatal("Unknown padding param. {}".format(border))
          raise
      self.border = spatial_border
      self.image_name = set(image_name)
      self.mode = mode
      self.pad_to = pad_to
      self.full_border = None
  
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 1 to create a new PadLayer object from inherited base classes: Layer, Invertible with example: obj = PadLayer(image_name, border, name, mode, pad_to)