lazylabel-gui 1.3.2__py3-none-any.whl → 1.3.4__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -270,10 +270,6 @@ class MultiIndicatorSlider(QWidget):
270
270
  """Handle right-click to remove indicator."""
271
271
  slider_rect = self.get_slider_rect()
272
272
 
273
- # Only allow removal if more than 1 indicator
274
- if len(self.indicators) <= 1:
275
- return
276
-
277
273
  # Check if right-clicking on an indicator
278
274
  for i, value in enumerate(self.indicators):
279
275
  x = self.value_to_x(value)
@@ -473,7 +469,7 @@ class ChannelThresholdWidget(QWidget):
473
469
 
474
470
  if self.current_image_channels == 1:
475
471
  # Grayscale image
476
- if "Gray" in self.sliders:
472
+ if "Gray" in self.sliders and self.sliders["Gray"].is_enabled():
477
473
  result = self._apply_channel_thresholding(
478
474
  result, self.sliders["Gray"].get_indicators()
479
475
  )
@@ -481,7 +477,10 @@ class ChannelThresholdWidget(QWidget):
481
477
  # RGB image
482
478
  channel_names = ["Red", "Green", "Blue"]
483
479
  for i, channel_name in enumerate(channel_names):
484
- if channel_name in self.sliders:
480
+ if (
481
+ channel_name in self.sliders
482
+ and self.sliders[channel_name].is_enabled()
483
+ ):
485
484
  result[:, :, i] = self._apply_channel_thresholding(
486
485
  result[:, :, i], self.sliders[channel_name].get_indicators()
487
486
  )
@@ -494,7 +493,7 @@ class ChannelThresholdWidget(QWidget):
494
493
  if not indicators:
495
494
  return channel_data
496
495
 
497
- # Sort indicators
496
+ # Sort indicators
498
497
  sorted_indicators = sorted(indicators)
499
498
 
500
499
  # Create output array
@@ -527,9 +526,9 @@ class ChannelThresholdWidget(QWidget):
527
526
  return result
528
527
 
529
528
  def has_active_thresholding(self):
530
- """Check if any channel has active thresholding (indicators present)."""
529
+ """Check if any channel has active thresholding (enabled and indicators present)."""
531
530
  for slider_widget in self.sliders.values():
532
- if slider_widget.get_indicators():
531
+ if slider_widget.is_enabled() and slider_widget.get_indicators():
533
532
  return True
534
533
  return False
535
534
 
@@ -308,6 +308,8 @@ class FFTThresholdWidget(QWidget):
308
308
  self.status_label.setStyleSheet(
309
309
  "color: #F44336; font-size: 9px; font-style: italic;"
310
310
  )
311
+ # Disable FFT processing for color images
312
+ self.enable_checkbox.setChecked(False)
311
313
  else:
312
314
  # Unknown format
313
315
  self.current_image_channels = 0
@@ -315,6 +317,8 @@ class FFTThresholdWidget(QWidget):
315
317
  self.status_label.setStyleSheet(
316
318
  "color: #F44336; font-size: 9px; font-style: italic;"
317
319
  )
320
+ # Disable FFT processing for unsupported formats
321
+ self.enable_checkbox.setChecked(False)
318
322
 
319
323
  def is_active(self):
320
324
  """Check if FFT processing is active (checkbox enabled and image is grayscale)."""
@@ -111,6 +111,15 @@ class CustomDropdown(QToolButton):
111
111
  text, _ = self.items[index]
112
112
  self.setText(text)
113
113
 
114
+ def count(self):
115
+ """Get number of items."""
116
+ return len(self.items)
117
+
118
+ def currentData(self):
119
+ """Get data of currently selected item."""
120
+ current_idx = self.currentIndex()
121
+ return self.itemData(current_idx)
122
+
114
123
  def blockSignals(self, block):
115
124
  """Block/unblock signals."""
116
125
  super().blockSignals(block)