def dilated(self, structure=None, connectivity=2, iterations=100):
"""
This function ...
:param connectivity:
:param iterations:
:return:
"""
# Define the structure for the expansion
if structure is None: structure = ndimage.generate_binary_structure(2, connectivity=connectivity)
# Make the new mask, made from 100 iterations with the structure array
data = ndimage.binary_dilation(self, structure, iterations)
# Return the dilated mask
#data, name=None, description=None
return Mask(data, name=self.name, description=self.description)
# -----------------------------------------------------------------
评论列表
文章目录