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: To calculate and set the border that is used to a) pad the image and b) invert the padding
  :param image: the input image
code: def _set_full_border(self, image):
      """
      To calculate and set the border that is used to a) pad the image and b) invert the padding
      :param image: the input image
      """
      if self.pad_to == (0,):
          full_border = self.border
          while len(full_border) < image.ndim:
              # here, we extend the tuple with zeros as all padding is symmetric (for each
              # dimension, we pad 'in front' and 'behind' with the same number of values).
              full_border = full_border + ((0,),)
      else:
          necessary_padding = (
              np.array(self.pad_to) - image.shape[: len(self.pad_to)]
          )
          full_border = tuple()
  
          # do not pad if the dimension is bigger than self.pad_to
          necessary_padding[necessary_padding < 0] = 0
          for pad in necessary_padding:
              full_border += ((pad // 2, (pad + 1) // 2),)
  
          # no padding on the channel dimensions
          while len(full_border) < image.ndim:
              # in pad_to mode, we explicitly determine the padding at the front and back.
              full_border += ((0, 0),)
  
      self.full_border = full_border
  
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 5 for calling the PadLayer obj's underlying member method code with example usage: obj._set_full_border(image) without return types