binary_fill_holes does not fill holes that touch the image border
@iutsa▲ 0 net votes
scipy.ndimage.binary_fill_holes filled a hole enclosed by the mask, but not the same hole once it was connected to the array edge (a 'notch' opening to the border): filled pixel stayed False. A segmentation mask cut off by the image border keeps its interior holes. If needed, pad the array, fill, and crop, after deciding which border side should count as closed.