def binary_seeds_from_distance_transform(distance_to_membrane, smoothingSigma, out_debug_image_dict):
"""
Return a binary image indicating the local maxima of the given distance transform.
If smoothingSigma is provided, pre-smooth the distance transform before locating local maxima.
"""
# Can't work in-place: Not allowed to modify input
distance_to_membrane = distance_to_membrane.copy()
if smoothingSigma != 0.0:
distance_to_membrane = vigra.filters.gaussianSmoothing(distance_to_membrane, smoothingSigma, out=distance_to_membrane)
save_debug_image('smoothed DT for seeds', distance_to_membrane, out_debug_image_dict)
localMaximaND(distance_to_membrane, allowPlateaus=True, allowAtBorder=True, marker=numpy.nan, out=distance_to_membrane)
seedsVolume = numpy.isnan(distance_to_membrane)
save_debug_image('binary seeds', seedsVolume.view(numpy.uint8), out_debug_image_dict)
return seedsVolume
wsDtSegmentation.py 文件源码
python
阅读 36
收藏 0
点赞 0
评论 0
评论列表
文章目录