spatial_image_analysis.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:tissue_analysis 作者: VirtualPlants 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号