本文整理汇总了Python中volumina.layer.ColortableLayer.colortableIsRandom方法的典型用法代码示例。如果您正苦于以下问题:Python ColortableLayer.colortableIsRandom方法的具体用法?Python ColortableLayer.colortableIsRandom怎么用?Python ColortableLayer.colortableIsRandom使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类volumina.layer.ColortableLayer
的用法示例。
在下文中一共展示了ColortableLayer.colortableIsRandom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setupLayers
# 需要导入模块: from volumina.layer import ColortableLayer [as 别名]
# 或者: from volumina.layer.ColortableLayer import colortableIsRandom [as 别名]
def setupLayers(self):
layers = []
op = self.topLevelOperatorView
# Superpixels
if op.Superpixels.ready():
layer = ColortableLayer( LazyflowSource(op.Superpixels), self._sp_colortable )
layer.colortableIsRandom = True
layer.name = "Superpixels"
layer.visible = True
layer.opacity = 0.5
layers.append(layer)
del layer
# Debug layers
if op.debug_results:
for name, compressed_array in op.debug_results.items():
axiskeys = op.Superpixels.meta.getAxisKeys()[:-1] # debug images don't have a channel axis
permutation = map(lambda key: axiskeys.index(key) if key in axiskeys else None, 'txyzc')
arraysource = ArraySource( TransposedView(compressed_array, permutation) )
if compressed_array.dtype == np.uint32:
layer = ColortableLayer(arraysource, self._sp_colortable)
else:
layer = GrayscaleLayer(arraysource)
# TODO: Normalize? Maybe the drange should be included with the debug image.
layer.name = name
layer.visible = False
layer.opacity = 1.0
layers.append(layer)
del layer
# Threshold
if op.ThresholdedInput.ready():
layer = ColortableLayer( LazyflowSource(op.ThresholdedInput), self._threshold_colortable )
layer.name = "Thresholded Input"
layer.visible = True
layer.opacity = 1.0
layers.append(layer)
del layer
# Raw Data (grayscale)
if op.Input.ready():
layer = self._create_grayscale_layer_from_slot( op.Input, op.Input.meta.getTaggedShape()['c'] )
layer.name = "Input"
layer.visible = False
layer.opacity = 1.0
layers.append(layer)
del layer
# Raw Data (grayscale)
if op.RawData.ready():
layer = self.createStandardLayerFromSlot( op.RawData )
layer.name = "Raw Data"
layer.visible = True
layer.opacity = 1.0
layers.append(layer)
del layer
return layers