def METHOD_NAME(bimask):
    if len(bimask.shape) == 3:
        return _mask.METHOD_NAME(bimask)
    elif len(bimask.shape) == 2:
        h, w = bimask.shape
        return _mask.METHOD_NAME(bimask.reshape((h, w, 1), order='F'))[0]