Generate a binary structure for binary morphological operations.
The inputs are the rank of the array to which the structure will be applied and the square of the connectivity of the structure.
scipy.ndimage.morphology.distance_transform_edt
scipy.ndimage.morphology.grey_closing