code: def fixup_scipy_ndimage_result(whatever_it_returned):
      
      if getattr(whatever_it_returned,"__getitem__",False):
          return np.array(whatever_it_returned)
      else:
          return np.array([whatever_it_returned])
docs: Convert a result from scipy.ndimage to a numpy array
      
      scipy.ndimage has the annoying habit of returning a single, bare
      value instead of an array if the indexes passed in are of length 1.
      For instance:
      scind.maximum(image, labels, [1]) returns a float
      but
      scind.maximum(image, labels, [1,2]) returns a list