def setupLayers(self): layers = [self.createStandardLayerFromSlot(self.topLevelOperatorView.Input)] layers[0].opacity = 1.0 superVoxelBoundarySlot = self.topLevelOperatorView.BoundariesOutput if superVoxelBoundarySlot.ready(): layer = AlphaModulatedLayer( LazyflowSource(superVoxelBoundarySlot), tintColor=QColor(Qt.blue), range=(0.0, 1.0), normalize=(0.0, 1.0), ) layer.name = "Supervoxel Boundaries" layer.visible = True layer.opacity = 1.0 layers.insert(0, layer) superVoxelSlot = self.topLevelOperatorView.Output if superVoxelSlot.ready(): colortable = generateRandomColors(M=256, clamp={"v": 1.0, "s": 0.5}, zeroIsTransparent=False) layer = ColortableLayer(createDataSource(superVoxelSlot), colortable) layer.colortableIsRandom = True layer.name = "SLIC Superpixels" layer.visible = True layer.opacity = 1.0 layers.insert(0, layer) return layers
def __init__(self, parentApplet, topLevelOperatorView): self.__cleanup_fns = [] self._currently_updating = False self.topLevelOperatorView = topLevelOperatorView super(WsdtGui, self).__init__( parentApplet, topLevelOperatorView ) self._sp_colortable = generateRandomColors(256, clamp={'v': 1.0, 's' : 0.5}, zeroIsTransparent=True) self._threshold_colortable = [ QColor(0, 0, 0, 0).rgba(), # transparent QColor(0, 255, 0, 255).rgba() ] # green # Any time watershed is re-computed, re-update the layer set, in case the set of debug layers has changed. self.topLevelOperatorView.watershed_completed.subscribe( self.updateAllLayers )
def __init__(self, parentApplet, topLevelOperatorView): self.__cleanup_fns = [] self._currently_updating = False self.topLevelOperatorView = topLevelOperatorView super(WsdtGui, self).__init__(parentApplet, topLevelOperatorView) self._sp_colortable = generateRandomColors(256, clamp={ "v": 1.0, "s": 0.5 }, zeroIsTransparent=True) self._threshold_colortable = [ QColor(0, 0, 0, 0).rgba(), QColor(0, 255, 0, 255).rgba() ] # transparent # green