diff --git a/cellacdc/dataPrep.py b/cellacdc/dataPrep.py index 42b88055..29eb20e1 100755 --- a/cellacdc/dataPrep.py +++ b/cellacdc/dataPrep.py @@ -189,14 +189,6 @@ def gui_createActions(self): self.loadPosAction = QAction("Load different Position...", self) self.loadPosAction.setShortcut("Shift+P") - - toolTip = ( - "Add crop ROI for multiple crops\n\n" - "Multiple crops will be saved as Position_1, Position_2 " - "as sub-folders in the current Position." - ) - self.addCropRoiActon = QAction(QIcon(":add_crop_ROI.svg"), toolTip, self) - self.addCropRoiActon.setDisabled(True) toolTip = "Add ROI where to calculate background intensity" self.addBkrgRoiActon = QAction(QIcon(":bkgrRoi.svg"), toolTip, self) @@ -260,7 +252,7 @@ def gui_createToolBars(self): # navigateToolbar.addAction(self.jumpBackwardAction) # navigateToolbar.addAction(self.jumpForwardAction) - navigateToolbar.addAction(self.addCropRoiActon) + navigateToolbar.addAction(self.addBkrgRoiActon) navigateToolbar.addAction(self.ZbackAction) @@ -284,7 +276,6 @@ def gui_connectActions(self): self.openRecentMenu.aboutToShow.connect(self.populateOpenRecent) self.exitAction.triggered.connect(self.close) self.showInExplorerAction.triggered.connect(self.showInExplorer) - self.addCropRoiActon.triggered.connect(self.addCropROI) self.addBkrgRoiActon.triggered.connect(self.addDefaultBkgrROI) self.cropAction.triggered.connect(self.crop_cb) self.cropZaction.toggled.connect(self.openCropZtool) @@ -435,7 +426,7 @@ def updatePos(self): self.updateCropZtool() self.setImageNameText() self.update_img() - self.addAndConnectCropROIs() + self.updateROI() self.updateBkgrROIs() self.saveBkgrROIs(self.data[self.pos_i]) @@ -532,10 +523,7 @@ def update_img(self): self.img.setImage(img) self.zSliceScrollBar.setMaximum(posData.SizeZ-1) - def addAndConnectROI(self, roi): - pass - - def addAndConnectCropROIs(self): + def updateROI(self): if self.startAction.isEnabled() or self.onlySelectingZslice: return @@ -1467,7 +1455,6 @@ def addROIs(self): self.ROIshapeComboBox.setCurrentText(items[-1]) for posData in self.data: - posData.cropROIs = [] if posData.dataPrep_ROIcoords is None: cropROI = self.getDefaultROI() else: @@ -1486,9 +1473,9 @@ def addROIs(self): ) self.setROIprops(cropROI) - posData.cropROIs.append(cropROI) + posData.cropROI = cropROI - self.addAndConnectCropROIs() + self.updateROI() try: self.ROIshapeComboBox.currentTextChanged.disconnect() @@ -1499,7 +1486,6 @@ def addROIs(self): ) self.addBkrgRoiActon.setDisabled(False) - self.addCropRoiActon.setDisabled(False) for posData in self.data: if not posData.bkgrROIs and not posData.bkgrDataExists: @@ -1554,9 +1540,6 @@ def setBkgrROIprops(self, bkgrROI): # bkgrROI.sigRegionChanged.connect(self.bkgrROIMoving) # bkgrROI.sigRegionChangeFinished.connect(self.bkgrROImovingFinished) - def addCropROI(self): - cropROI = self.getDefaultROI() - self.setROIprops(cropROI) def addDefaultBkgrROI(self, checked=False): bkgrROI = self.getDefaultBkgrROI() diff --git a/cellacdc/resources/icons/add_crop_ROI.svg b/cellacdc/resources/icons/add_crop_ROI.svg deleted file mode 100644 index 078a3573..00000000 --- a/cellacdc/resources/icons/add_crop_ROI.svg +++ /dev/null @@ -1,65 +0,0 @@ - - - - Crop