def __voxel_first_layer(self, keep_background=True):
"""
Extract the first layer of voxels at the surface of the biological object.
"""
print "Extracting the first layer of voxels..."
mask_img_1 = (self.image == self.background())
struct = nd.generate_binary_structure(3, 1)
dil_1 = nd.binary_dilation(mask_img_1, structure=struct)
layer = dil_1 - mask_img_1
if keep_background:
return self.image * layer + mask_img_1
else:
return self.image * layer
spatial_image_analysis.py 文件源码
python
阅读 23
收藏 0
点赞 0
评论 0
评论列表
文章目录