code: def _validate_image_rank(self, img_array):
          
          if img_array.ndim == 1 or img_array.ndim > 3:
              msg = "{0}D imagery is not allowed.".format(img_array.ndim)
              raise IOError(msg)
docs: Images must be either 2D or 3D.