> Maybe we could check that the image has only 2 values as it is done in
> intersect masks ?       assert len(np.unique(mask)) == 2, "Meaningful error
> message"

ok! That's a good idea.