Ejemplo n.º 1
0
    def __init__(self, *args, **kw):
        super(SegmentationDialog, self).__init__(*args, **kw)
        loadUI(splitext(__file__)[0]+'.ui', self)
        self.setWindowFlags(Qt.Tool)
        self.norm.setText("Intesity Norm. ")
        self._setupPrimaryMasks()

        # row count (rowCount from gridlayout is not reliable!)
        self._rcount = 1

        self.pchannel.currentIndexChanged[str].connect(self.onChannelChanged)
        self.loadBtn.clicked.connect(self.onLoadBtn)
        self.saveBtn.clicked.connect(self.onSaveBtn)

        self.zsliceMethod.addItems(ZProject.names())
        self.zsliceMethod.currentIndexChanged.connect(
            self.onZSliceMethodChanged)

        self.zslice.valueChanged.connect(self.emitImageUpdate)
        self.pmask.currentIndexChanged.connect(self.emitParamsChanged)
        self.pmask.currentIndexChanged.connect(self.pmaskShow)
Ejemplo n.º 2
0
    def __init__(self, *args, **kw):
        super(ImportDialog, self).__init__(*args, **kw)
        loadUI(splitext(__file__)[0] + ".ui", self)

        self.zsliceMethod.addItems(ZProject.names())
        self.zsliceMethod.currentIndexChanged.connect(self.onZSliceMethodChanged)

        self.pool = None
        self._pool_running = False

        for name, scn in FileScanner.iterclasses():
            self.structType.addItem(scn.icon(), name)

        self.structType.setIconSize(QtCore.QSize(48, 24))
        self._files = None
        self._regex = None

        self.progressBar.hide()

        self.segdlg = SegmentationDialog(self)
        self.segdlg.hide()
        self.zslice.valueChanged.connect(self.segdlg.setZSlice)
        self.segdlg.zslice.valueChanged.connect(self.zslice.setValue)
        self.zsliceMethod.currentIndexChanged.connect(self.segdlg.zsliceMethod.setCurrentIndex)

        self.segdlg.zsliceMethod.currentIndexChanged.connect(self.zsliceMethod.setCurrentIndex)

        self.viewer.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.MinimumExpanding)

        self.cbar = ChannelBar(self, self.viewer)
        self.cbox.addWidget(self.cbar)
        self.cbar.newPixmap.connect(self.viewer.showPixmap, Qt.DirectConnection)
        self.cbar.newContourImage.connect(self.viewer.contourImage)
        self.cbar.colorsChanged.connect(self.segdlg.updateRowColors)

        self.dataFileBtn.clicked.connect(self.onOpenOutFile)
        self.imageDirBtn.clicked.connect(self.onOpenImageDir)
        self.startBtn.clicked.connect(self.raw2hdf)
        self.closeBtn.clicked.connect(self.close)
        self.closeBtn.clicked.connect(self.cbar.clear)
        self.segmentationBtn.clicked.connect(self.onSegmentationBtn)

        self.slider.newValue.connect(self.showObjects)

        self.slider.valueChanged.connect(self.showImage)
        self.slider.sliderReleased.connect(self.showObjects)
        self.slider.sliderPressed.connect(self.cbar.clearContours)
        self.contoursCb.stateChanged.connect(self.onContours)
        self.showBBoxes.stateChanged.connect(self.onBBoxes)
        self.showBBoxes.stateChanged.connect(self.showObjects)
        self.segdlg.paramsChanged.connect(self.showObjects)
        self.segdlg.refreshBtn.clicked.connect(self.showObjects)
        self.segdlg.imageUpdate.connect(self.showImage)
        self.segdlg.activateChannels.connect(self.cbar.activateChannels)
        self.segdlg.changeColor.connect(self.cbar.setColor)

        self.nextBtn.clicked.connect(self.onNextBtn)
        self.prevBtn.clicked.connect(self.onPrevBtn)
        self.reloadBtn.clicked.connect(self.onReloadBtn)

        self.setProgressRange.connect(self.progressBar.setRange)
        self.setProgress.connect(self.progressBar.setValue, Qt.DirectConnection)