lazylabel-gui 1.2.0__py3-none-any.whl → 1.2.1__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.
@@ -789,9 +789,15 @@ class MainWindow(QMainWindow):
789
789
  # Update the main window's settings object with the latest from the widget
790
790
  self.settings.update(**self.control_panel.settings_widget.get_settings())
791
791
 
792
- # Re-load the current image to apply the new 'Operate On View' setting
792
+ # When operate on view setting changes, we need to force SAM model to update
793
+ # with proper scale factor recalculation via the worker thread
793
794
  if self.current_image_path:
794
- self._update_sam_model_image()
795
+ # Mark SAM as dirty and reset scale factor to force proper recalculation
796
+ self.sam_is_dirty = True
797
+ self.sam_scale_factor = 1.0 # Reset to default
798
+ self.current_sam_hash = None # Invalidate cache
799
+ # Use the worker thread to properly calculate scale factor
800
+ self._ensure_sam_updated()
795
801
 
796
802
  def _handle_image_adjustment_changed(self):
797
803
  """Handle changes in image adjustments (brightness, contrast, gamma)."""
@@ -2613,14 +2619,6 @@ class MainWindow(QMainWindow):
2613
2619
  self.main_splitter.setSizes([250, 800, 350])
2614
2620
 
2615
2621
  # Additional methods for new features
2616
- def _handle_settings_changed(self):
2617
- """Handle changes in settings, e.g., 'Operate On View'."""
2618
- # Update the main window's settings object with the latest from the widget
2619
- self.settings.update(**self.control_panel.settings_widget.get_settings())
2620
-
2621
- # Re-load the current image to apply the new 'Operate On View' setting
2622
- if self.current_image_path:
2623
- self._update_sam_model_image()
2624
2622
 
2625
2623
  def _handle_channel_threshold_changed(self):
2626
2624
  """Handle changes in channel thresholding - optimized to avoid unnecessary work."""
@@ -3379,9 +3377,9 @@ class MainWindow(QMainWindow):
3379
3377
  self.current_sam_hash = None # Invalidate cache
3380
3378
  self.sam_scale_factor = 1.0
3381
3379
 
3382
- # Clear all points and segments
3380
+ # Clear all points but preserve segments
3383
3381
  self.clear_all_points()
3384
- self.segment_manager.clear()
3382
+ # Note: Segments are preserved when switching models
3385
3383
  self._update_all_lists()
3386
3384
 
3387
3385
  # Clear preview items
@@ -3431,6 +3429,9 @@ class MainWindow(QMainWindow):
3431
3429
  if hasattr(self, "status_bar"):
3432
3430
  self.status_bar.clear_message()
3433
3431
 
3432
+ # Redisplay segments after model switch to restore visual representation
3433
+ self._display_all_segments()
3434
+
3434
3435
  def _transform_display_coords_to_sam_coords(self, pos):
3435
3436
  """Transform display coordinates to SAM model coordinates.
3436
3437
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: lazylabel-gui
3
- Version: 1.2.0
3
+ Version: 1.2.1
4
4
  Summary: An image segmentation GUI for generating ML ready mask tensors and annotations.
5
5
  Author-email: "Deniz N. Cakan" <deniz.n.cakan@gmail.com>
6
6
  License: MIT License
@@ -18,7 +18,7 @@ lazylabel/ui/editable_vertex.py,sha256=nAFC2UuFfbvMbGBbAiLWA77cS5-Hn3a08xe1_QLz2
18
18
  lazylabel/ui/hotkey_dialog.py,sha256=U_B76HLOxWdWkfA4d2XgRUaZTJPAAE_m5fmwf7Rh-5Y,14743
19
19
  lazylabel/ui/hoverable_pixelmap_item.py,sha256=kJFOp7WXiyHpNf7l73TZjiob85jgP30b5MZvu_z5L3c,728
20
20
  lazylabel/ui/hoverable_polygon_item.py,sha256=aclUwd0P8H8xbcep6GwhnfaVs1zSkqeZKAL-xeDyMiU,1222
21
- lazylabel/ui/main_window.py,sha256=653kC1XSoVDTHShc2nFexeQuHMEnBnDbnFRW7WnU590,145573
21
+ lazylabel/ui/main_window.py,sha256=fmyNsKGzL57mQk31OFEKUv-bwZB3iKzTKf_b90ht790,145682
22
22
  lazylabel/ui/numeric_table_widget_item.py,sha256=dQUlIFu9syCxTGAHVIlmbgkI7aJ3f3wmDPBz1AGK9Bg,283
23
23
  lazylabel/ui/photo_viewer.py,sha256=f93Mn9ajR2CYakJbbhhHvD5blKrwiGq3ZYgro-k2npc,4217
24
24
  lazylabel/ui/reorderable_class_table.py,sha256=sxHhQre5O_MXLDFgKnw43QnvXXoqn5xRKMGitgO7muI,2371
@@ -36,9 +36,9 @@ lazylabel/utils/__init__.py,sha256=V6IR5Gim-39HgM2NyTVT-n8gy3mjilCSFW9y0owN5nc,1
36
36
  lazylabel/utils/custom_file_system_model.py,sha256=-3EimlybvevH6bvqBE0qdFnLADVtayylmkntxPXK0Bk,4869
37
37
  lazylabel/utils/logger.py,sha256=R7z6ifgA-NY-9ZbLlNH0i19zzwXndJ_gkG2J1zpVEhg,1306
38
38
  lazylabel/utils/utils.py,sha256=sYSCoXL27OaLgOZaUkCAhgmKZ7YfhR3Cc5F8nDIa3Ig,414
39
- lazylabel_gui-1.2.0.dist-info/licenses/LICENSE,sha256=kSDEIgrWAPd1u2UFGGpC9X71dhzrlzBFs8hbDlENnGE,1092
40
- lazylabel_gui-1.2.0.dist-info/METADATA,sha256=EaZvrXq5f-M9PUdtyEa65fBcsF12EZYx9iM1DPMX130,7237
41
- lazylabel_gui-1.2.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
42
- lazylabel_gui-1.2.0.dist-info/entry_points.txt,sha256=Hd0WwEG9OPTa_ziYjiD0aRh7R6Fupt-wdQ3sspdc1mM,54
43
- lazylabel_gui-1.2.0.dist-info/top_level.txt,sha256=YN4uIyrpDBq1wiJaBuZLDipIzyZY0jqJOmmXiPIOUkU,10
44
- lazylabel_gui-1.2.0.dist-info/RECORD,,
39
+ lazylabel_gui-1.2.1.dist-info/licenses/LICENSE,sha256=kSDEIgrWAPd1u2UFGGpC9X71dhzrlzBFs8hbDlENnGE,1092
40
+ lazylabel_gui-1.2.1.dist-info/METADATA,sha256=3oudmKUge4EXthGYCBauKdxRjhVbY7LZAZqDE4aRNUI,7237
41
+ lazylabel_gui-1.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
42
+ lazylabel_gui-1.2.1.dist-info/entry_points.txt,sha256=Hd0WwEG9OPTa_ziYjiD0aRh7R6Fupt-wdQ3sspdc1mM,54
43
+ lazylabel_gui-1.2.1.dist-info/top_level.txt,sha256=YN4uIyrpDBq1wiJaBuZLDipIzyZY0jqJOmmXiPIOUkU,10
44
+ lazylabel_gui-1.2.1.dist-info/RECORD,,