Skip to content

Support translated scaled layers#59

Merged
zoccoler merged 10 commits intoBiAPoL:mainfrom
zoccoler:support_translated_scaled_layers
Jan 16, 2026
Merged

Support translated scaled layers#59
zoccoler merged 10 commits intoBiAPoL:mainfrom
zoccoler:support_translated_scaled_layers

Conversation

@zoccoler
Copy link
Contributor

This pull request introduces improvements and refactorings, focusing on improving translation handling. The plugin should not account for layers that have been previously translated and scaled. The main changes include deprecating the crop and translate arguments (now always applied), improving how layer translations are handled during cropping, and adding new menu entries to the Layers menu for alternative access to cropping tools.

Deprecations and Workflow Simplification

  • The crop argument in CutWithPlane and the translate argument in crop_region are now deprecated and always applied (⚠️change of usability⚠️). Users are warned if they attempt to use these arguments. [1] [2]
  • The crop checkbox and related logic have been removed from the UI and code, reflecting this simplification. [1] [2] [3] [4] [5]

Improved Translation Handling

  • Layer translation is now handled more robustly: when cropping, the output layer's translation is always computed based on the crop and any existing translation, ensuring spatial alignment. [1] [2] [3]
  • When cropping with translated layers, the shapes used for cropping are adjusted to account for the layer's translation and scale.

User Interface and Documentation Enhancements

  • New menu entries have been added under Layer > Transform for cropping and shape drawing tools, making these features more discoverable in the napari UI. [1] [2]
  • The documentation has been updated to reflect these new menu locations.

Fixed Shapes Drawing Improvements

  • The draw_fixed_shapes function now expects a Points layer (not just data - ⚠️breaking change since last version⚠️), synchronizes scale with the points layer, and uses a refactored helper to generate bounding boxes for shapes. Defaults for shape size have been adjusted. [1] [2]

Other Minor Improvements

  • Added user-facing warnings via napari's notification system when deprecated arguments are used. [1] [2]

References:

@zoccoler
Copy link
Contributor Author

This should fix #52 and #58

@zoccoler zoccoler merged commit 87e5def into BiAPoL:main Jan 16, 2026
11 checks passed
@zoccoler zoccoler deleted the support_translated_scaled_layers branch January 16, 2026 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant