def get_patch_values(point, target_image, radius=5, shape='circle', morfo_mask=None):
"""
To obtain the list of the values below a maks.
:param point:
:param target_image:
:param radius:
:param shape:
:param morfo_mask: To avoid computing the morphological mask at each iteration if this method is called in a loop, this can be provided as input.
:return:
"""
if morfo_mask is None:
morfo_mask = get_morphological_mask(point, target_image.shape, radius=radius, shape=shape)
coord = np.nonzero(morfo_mask.flatten())[0]
return np.take(target_image.flatten(), coord)
# def midpoint_circle_algorithm(center=(0, 0, 0), radius=4):
# x, y, z = center
# # TODO generalise the midpoint circle algorithm and use it for get_shell_for_given_radius
# pass
morpological_operations.py 文件源码
python
阅读 35
收藏 0
点赞 0
评论 0
评论列表
文章目录