本文整理汇总了Python中EditUtil.EditUtil.setLabel方法的典型用法代码示例。如果您正苦于以下问题:Python EditUtil.setLabel方法的具体用法?Python EditUtil.setLabel怎么用?Python EditUtil.setLabel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EditUtil.EditUtil
的用法示例。
在下文中一共展示了EditUtil.setLabel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: edit
# 需要导入模块: from EditUtil import EditUtil [as 别名]
# 或者: from EditUtil.EditUtil import setLabel [as 别名]
def edit(self,label):
"""select the picked label for editing"""
merge = self.merge
if not merge:
return
colorNode = merge.GetDisplayNode().GetColorNode()
structureName = colorNode.GetColorName( label )
structureVolume = self.structureVolume( structureName )
EditUtil.setActiveVolumes(self.master, structureVolume)
EditUtil.setLabel(label)
示例2: processEvent
# 需要导入模块: from EditUtil import EditUtil [as 别名]
# 或者: from EditUtil.EditUtil import setLabel [as 别名]
def processEvent(self, caller=None, event=None):
"""
handle events from the render window interactor
"""
if super(PaintEffectTool,self).processEvent(caller,event):
return
# interactor events
if event == "LeftButtonPressEvent":
self.actionState = "painting"
if not self.pixelMode:
self.cursorOff()
xy = self.interactor.GetEventPosition()
if self.smudge:
EditUtil.setLabel(self.getLabelPixel(xy))
self.paintAddPoint(xy[0], xy[1])
self.abortEvent(event)
elif event == "LeftButtonReleaseEvent":
self.paintApply()
self.actionState = None
self.cursorOn()
elif event == "MouseMoveEvent":
self.actor.VisibilityOn()
if self.actionState == "painting":
xy = self.interactor.GetEventPosition()
self.paintAddPoint(xy[0], xy[1])
self.abortEvent(event)
elif event == "EnterEvent":
self.actor.VisibilityOn()
elif event == "LeaveEvent":
self.actor.VisibilityOff()
elif event == "KeyPressEvent":
key = self.interactor.GetKeySym()
if key == 'plus' or key == 'equal':
self.scaleRadius(1.2)
if key == 'minus' or key == 'underscore':
self.scaleRadius(0.8)
else:
pass
# events from the slice node
if caller and caller.IsA('vtkMRMLSliceNode'):
if hasattr(self,'brush'):
self.createGlyph(self.brush)
self.positionActors()