code: def __extract_bbox(arr, bb_old):
      "Extracts the bounding box of an binary objects hole (assuming only one in existence)."
      hole = ndimage.binary_fill_holes(arr)- arr
      bb_list = ndimage.find_objects(ndimage.binary_dilation(hole, iterations = 1))
      if 0 == len(bb_list): return bb_old
      else: bb = bb_list[0]
      
      if not bb_old: return list(bb)
      
      for i in range(len(bb_old)):
          bb_old[i] = slice(min(bb_old[i].start, bb[i].start),
                            max(bb_old[i].stop, bb[i].stop))
      return bb_olf __extract_bbox(arr, bb_old):
      "Extracts the bounding box of an binary objects hole (assuming only one in existence)."
      hole = ndimage.binary_fill_holes(arr)- arr
      bb_list = ndimage.find_objects(ndimage.binary_dilation(hole, iterations = 1))
      if 0 == len(bb_list): return bb_old
      else: bb = bb_list[0]
      
      if not bb_old: return list(bb)
      
      for i in range(len(bb_old)):
          bb_old[i] = slice(min(bb_old[i].start, bb[i].start),
                            max(bb_old[i].stop, bb[i].stop))
      return bb_old
docs: Extracts the bounding box of an binary objects hole (assuming only one in existence).