Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Teranis committed Nov 12, 2024
2 parents 92bc540 + be1b21c commit 36dcfd4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 25 deletions.
28 changes: 6 additions & 22 deletions cellacdc/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -17627,7 +17627,6 @@ def switchViewedPlane(self, previousPlane, currentPlane):
self.overlayButtonPrevState = self.overlayButton.isChecked()
self.overlayButton.setChecked(False)
self.overlayButton.setDisabled(True)
# self.setZprojDisabled(True, storePrevState=True)
else:
self.zProjComboBox.setDisabled(False)
self.restoreAnnotationsOptions()
Expand All @@ -17637,7 +17636,6 @@ def switchViewedPlane(self, previousPlane, currentPlane):
if self.overlayButtonPrevState:
self.overlayButton.setChecked(self.overlayButtonPrevState)
self.updateZsliceScrollbar(posData.frame_i)
# self.restoreZprojWidgetsEnabled()

SizeY, SizeX = posData.img_data[posData.frame_i].shape[-2:]

Expand Down Expand Up @@ -17705,42 +17703,28 @@ def updateZproj(self, how):

posData = self.data[self.pos_i]
if how == 'single z-slice':
self.zSliceScrollBar.setDisabled(False)
self.zSliceSpinbox.setDisabled(False)
self.zSliceCheckbox.setDisabled(False)
self.setZprojDisabled(False)
self.update_z_slice(self.zSliceScrollBar.sliderPosition())
else:
self.zSliceScrollBar.setDisabled(True)
self.zSliceSpinbox.setDisabled(True)
self.zSliceCheckbox.setDisabled(True)
self.setZprojDisabled(self.isSegm3D)
self.updateAllImages()

def setZprojDisabled(self, disabled, storePrevState=False):
if storePrevState:
self._ZprojWidgersEnabledState = {
self.zSliceScrollBar: disabled,
self.zSliceSpinbox: disabled,
self.zSliceCheckbox: disabled,
}
else:
self._ZprojWidgersEnabledState = None
self.zSliceScrollBar.setDisabled(disabled)
self.zSliceSpinbox.setDisabled(disabled)
self.zSliceCheckbox.setDisabled(disabled)
for action in self.editToolBar.actions():
button = self.editToolBar.widgetForAction(action)
if button == self.eraserButton:
continue
action.setDisabled(disabled)
if storePrevState:
self._ZprojWidgersEnabledState[action] = disabled
try:
button.setChecked(False)
except Exception as err:
pass

def restoreZprojWidgetsEnabled(self):
if self._ZprojWidgersEnabledState is None:
return

for qobject, disabled in self._ZprojWidgersEnabledState.items():
qobject.setDisabled(disabled)

def clearAx2Items(self, onlyHideText=False):
self.ax2_binnedIDs_ScatterPlot.clear()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import skimage
import numpy as np
from .core import segm_model_segment, post_process_segm
from .features import custom_post_process_segm
from ...core import segm_model_segment, post_process_segm
from ...features import custom_post_process_segm

import os # for dbug
import json # for dbug
Expand Down
2 changes: 1 addition & 1 deletion cellacdc/workers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
from . import cca_df_colnames, lineage_tree_cols, default_annot_df
from . import cca_df_colnames_with_tree
from .utils import resize
from .localCellTracking import single_cell_seg
from .trackers.CellACDC_normal_division.localCellTracking import single_cell_seg

DEBUG = False

Expand Down

0 comments on commit 36dcfd4

Please sign in to comment.