本文整理汇总了Python中volumina.api.AlphaModulatedLayer.ref_object方法的典型用法代码示例。如果您正苦于以下问题:Python AlphaModulatedLayer.ref_object方法的具体用法?Python AlphaModulatedLayer.ref_object怎么用?Python AlphaModulatedLayer.ref_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类volumina.api.AlphaModulatedLayer
的用法示例。
在下文中一共展示了AlphaModulatedLayer.ref_object方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: addPredictionLayer
# 需要导入模块: from volumina.api import AlphaModulatedLayer [as 别名]
# 或者: from volumina.api.AlphaModulatedLayer import ref_object [as 别名]
def addPredictionLayer(self, icl, ref_label):
selector=OpSingleChannelSelector(self.g)
selector.inputs["Input"].connect(self.pCache.outputs['Output'])
selector.inputs["Index"].setValue(icl)
if self.checkInteractive.isChecked():
self.pCache.inputs["fixAtCurrent"].setValue(False)
else:
self.pCache.inputs["fixAtCurrent"].setValue(True)
predictsrc = LazyflowSource(selector.outputs["Output"][0])
def srcName(newName):
predictsrc.setObjectName("Prediction for %s" % ref_label.name)
srcName("")
predictLayer = AlphaModulatedLayer(predictsrc, tintColor=ref_label.color)
predictLayer.nameChanged.connect(srcName)
def setLayerColor(c):
print "as the color of label '%s' has changed, setting layer's '%s' tint color to %r" % (ref_label.name, predictLayer.name, c)
predictLayer.tintColor = c
ref_label.colorChanged.connect(setLayerColor)
def setLayerName(n):
newName = "Prediction for %s" % ref_label.name
print "as the name of label '%s' has changed, setting layer's '%s' name to '%s'" % (ref_label.name, predictLayer.name, newName)
predictLayer.name = newName
setLayerName(ref_label.name)
ref_label.nameChanged.connect(setLayerName)
predictLayer.ref_object = ref_label
#make sure that labels (index = 0) stay on top!
self.layerstack.insert(1, predictLayer )
self.fixableOperators.append(self.pCache)