a=vigra.filters.discDilation(a,radius=20) array[:]=a.reshape(shape).view(np.ndarray)*255 op.Input.setDirty() do() cron.connect(cron, SIGNAL('timeout()'), do) ds = LazyflowSource( op.Output ) layer = ColortableLayer(ds,jet()) mainwin=Viewer() mainwin.layerstack.append(layer) mainwin.dataShape=(1,h,w,1,1) print mainwin.centralWidget() BoxContr=BoxController(mainwin.editor,op.Output,boxListModel) BoxInt=BoxInterpreter(mainwin.editor.navInterpret,mainwin.editor.posModel,BoxContr,mainwin.centralWidget()) mainwin.editor.setNavigationInterpreter(BoxInt) # boxListModel.boxRemoved.connect(BoxContr.deleteItem) LV.show() mainwin.show() app.exec_()
a = np.zeros(500 * 500).reshape(500, 500).astype(np.uint8) ii = np.random.randint(0, 500, 1) jj = np.random.randint(0, 500, 1) a[ii, jj] = 1 a = vigra.filters.discDilation(a, radius=20) array[:] = a.reshape(shape).view(np.ndarray) * 255 op.Input.setDirty() do() cron.timeout.connect(do) ds = createDataSource(op.Output) layer = ColortableLayer(ds, jet()) mainwin = Viewer() mainwin.layerstack.append(layer) mainwin.dataShape = (1, h, w, 1, 1) print(mainwin.centralWidget()) BoxContr = BoxController(mainwin.editor, op.Output, boxListModel) BoxInt = BoxInterpreter(mainwin.editor.navInterpret, mainwin.editor.posModel, BoxContr, mainwin.centralWidget()) mainwin.editor.setNavigationInterpreter(BoxInt) # boxListModel.boxRemoved.connect(BoxContr.deleteItem) LV.show() mainwin.show() app.exec_()
jj = np.random.randint(0, 500, 1) a[ii, jj] = 1 a = vigra.filters.discDilation(a, radius=20) array[:] = a.reshape(shape).view(np.ndarray) * 255 op.Input.setDirty() do() cron.timeout.connect(do) ds = LazyflowSource(op.Output) layer = ColortableLayer(ds, jet()) mainwin = Viewer() mainwin.layerstack.append(layer) mainwin.dataShape = (1, h, w, 1, 1) print(mainwin.centralWidget()) BoxContr = BoxController(mainwin.editor, op.Output, boxListModel) BoxInt = BoxInterpreter(mainwin.editor.navInterpret, mainwin.editor.posModel, BoxContr, mainwin.centralWidget()) mainwin.editor.setNavigationInterpreter(BoxInt) # boxListModel.boxRemoved.connect(BoxContr.deleteItem) LV.show() mainwin.show() app.exec_()
mainwin.editor.brushingModel.erasingNumber = 0 def _handleSelection(int): if int == 0: mainwin.editor.brushingModel.setErasing() else: # mainwin.editor.brushingModel.disableErasing() mainwin.editor.brushingModel.setDrawnNumber(int) if int == 1: mainwin.editor.brushingModel.setBrushColor(QColor(255, 0, 0)) mainwin.editor.brushingModel.setBrushSize(1) else: mainwin.editor.brushingModel.setBrushSize(20) mainwin.editor.brushingModel.setBrushColor(QColor(0, 255, 0)) labelListModel.elementSelected.connect(_handleSelection) mainwin.layerstack.append(layer) mainwin.dataShape = (1, 500, 500, 1, 1) logger.debug(str(mainwin.centralWidget())) BoxContr = DotController(mainwin.editor.imageScenes[2], mainwin.editor.brushingController) BoxInt = DotInterpreter(mainwin.editor.navCtrl, mainwin.editor.brushingController, BoxContr) mainwin.editor.setNavigationInterpreter(BoxInt) labelListModel.select(1) LV.show() mainwin.show() app.exec_()
def _handleSelection(int): if int == 0: mainwin.editor.brushingModel.setErasing() else: #mainwin.editor.brushingModel.disableErasing() mainwin.editor.brushingModel.setDrawnNumber(int) if int == 1: mainwin.editor.brushingModel.setBrushColor(QColor(255, 0, 0)) mainwin.editor.brushingModel.setBrushSize(1) else: mainwin.editor.brushingModel.setBrushSize(20) mainwin.editor.brushingModel.setBrushColor(QColor(0, 255, 0)) labelListModel.elementSelected.connect(_handleSelection) mainwin.layerstack.append(layer) mainwin.dataShape = (1, 500, 500, 1, 1) logger.debug(str(mainwin.centralWidget())) BoxContr = DotController(mainwin.editor.imageScenes[2], mainwin.editor.brushingController) BoxInt = DotInterpreter(mainwin.editor.navCtrl, mainwin.editor.brushingController, BoxContr) mainwin.editor.setNavigationInterpreter(BoxInt) labelListModel.select(1) LV.show() mainwin.show() app.exec_()
else: #mainwin.editor.brushingModel.disableErasing() mainwin.editor.brushingModel.setDrawnNumber(int) if int==1: mainwin.editor.brushingModel.setBrushColor(QColor(255,0,0)) mainwin.editor.brushingModel.setBrushSize(1) else: mainwin.editor.brushingModel.setBrushSize(20) mainwin.editor.brushingModel.setBrushColor(QColor(0,255,0)) labelListModel.elementSelected.connect(_handleSelection) mainwin.layerstack.append(layer) mainwin.dataShape=(1,500,500,1,1) print mainwin.centralWidget() BoxContr=DotController(mainwin.editor.imageScenes[2],mainwin.editor.brushingControler) BoxInt=DotInterpreter(mainwin.editor.navCtrl,mainwin.editor.brushingControler,BoxContr) mainwin.editor.setNavigationInterpreter(BoxInt) labelListModel.select(1) LV.show() mainwin.show() app.exec_()
jj = np.random.randint(0, 500, 1) a[ii, jj] = 1 a = vigra.filters.discDilation(a, radius=20) array[:] = a.reshape(shape).view(np.ndarray) * 255 op.Input.setDirty() do() cron.connect(cron, SIGNAL('timeout()'), do) ds = LazyflowSource(op.Output) layer = ColortableLayer(ds, jet()) mainwin = Viewer() mainwin.layerstack.append(layer) mainwin.dataShape = (1, 500, 500, 1, 1) print mainwin.centralWidget() BoxContr = BoxController(mainwin.editor.imageScenes[2], op.Output, boxListModel) BoxInt = BoxInterpreter(mainwin.editor.navInterpret, mainwin.editor._posModel, BoxContr, mainwin.centralWidget()) mainwin.editor.setNavigationInterpreter(BoxInt) # boxListModel.boxRemoved.connect(BoxContr.deleteItem) LV.show() mainwin.show() app.exec_()