Efficient dilation, erosion, opening, and closing algorithms | Synapse