当前位置: 首页>>代码示例>>Python>>正文


Python EditUtil.setLabel方法代码示例

本文整理汇总了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)
开发者ID:LucasGandel,项目名称:Slicer,代码行数:15,代码来源:LabelStructureListWidget.py

示例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()
开发者ID:filipemanuel1,项目名称:Slicer,代码行数:49,代码来源:PaintEffect.py


注:本文中的EditUtil.EditUtil.setLabel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。