code: def convert_to_odl(image):
      
  
      shape = image.shape
  
      if len(shape) == 2:
          space = odl.uniform_discr([0, 0], shape, shape)
      elif len(shape) == 3:
          d = shape[2]
          shape = shape[:2]
          image = np.transpose(image, (2, 0, 1))
          space = odl.uniform_discr([0, 0], shape, shape) ** d
  
      image = space.element(image)
  
      return image
docs: Convert image to ODL object.