branchmaskcreator.py 文件源码

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

项目:SamuROI 作者: samuroi 项目源码 文件源码
def __update_artist(self):
        # check if this is the first point of a branch
        if self.artist is None:
            self.artist = Circle([self.x[0], self.y[0]], radius=self.r[0], fill=False,
                                 lw=2, color='red')
            self.axes.add_artist(self.artist)
        elif len(self.x) == 0:
            self.artist.remove()
            self.artist = None
        elif len(self.x) == 1:
            self.artist.remove()
            self.artist = Circle([self.x[0], self.y[0]], radius=self.r[0], fill=False,
                                 lw=2, color='red')
            self.axes.add_artist(self.artist)
        # change from circle to polygon if more than 1 points are available
        elif len(self.x) == 2:
            self.artist.remove()
            branch = Branch(x=self.x, y=self.y, z=[0 for i in self.x], r=self.r)
            self.artist = Polygon(branch.outline, fill=False, color='red', lw=2)
            self.axes.add_artist(self.artist)
        else:
            assert (len(self.x) > 2)
            branch = Branch(x=self.x, y=self.y, z=[0 for i in self.x], r=self.r)
            self.artist.set_xy(branch.outline)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号