code: def odd_to_even(image):
      """
      To facilitate 2x2 downsampling segmentation, change an odd sized image into an even sized one.
      Works by mirroring the starting 1 pixel edge of the image on odd shaped sides.
  
      e.g. turn a 3x3x5 image into a 4x4x5 (the x and y are what are getting downsampled)
  
      For example: [ 3, 2, 4 ] => [ 3, 3, 2, 4 ] which is now easy to downsample.
  
      """
      shape = np.array(image.shape)
  
      offset = (shape % 2)[:2]  # x,y offset
  
      # detect if we're dealing with an even
      # image. if so it's fine, just return.
      if not np.any(offset):
          return image
  
      oddshape = image.shape[:2] + offset
      oddshape = np.append(oddshape, shape[2:])
      oddshape = oddshape.astype(int)
  
      newimg = np.empty(shape=oddshape, dtype=image.dtype)
  
      ox, oy = offset
      sx, sy = oddshape
  
      newimg[0, 0] = image[0, 0]  # corner
      newimg[ox:sx, 0] = image[:, 0]  # x axis line
      newimg[0, oy:sy] = image[0, :]  # y axis line
  
      return newimg
  
imports: from __future__ import print_function, division
  import six
  from six.moves import range
  from collections import defaultdict
  from functools import reduce
  import operator
  import io
  import os
  from PIL import Image
  import math
  import numpy
  import random
  import sys
  import time
  from tqdm import tqdm
  from scipy import ndimage
label_desc: Use image node_id 11 for calling a global function with example usage: odd_to_even(image) and returns: newimg, image