Skip to content

Commit

Permalink
fix: restored correct version of dataprep
Browse files Browse the repository at this point in the history
  • Loading branch information
ElpadoCan committed Aug 9, 2023
1 parent 87107b6 commit 335e3de
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 87 deletions.
27 changes: 5 additions & 22 deletions cellacdc/dataPrep.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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])

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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:
Expand All @@ -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()
Expand All @@ -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:
Expand Down Expand Up @@ -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()
Expand Down
65 changes: 0 additions & 65 deletions cellacdc/resources/icons/add_crop_ROI.svg

This file was deleted.

0 comments on commit 335e3de

Please sign in to comment.