pysnt.display.core module#
Core display functionality for PySNT.
This module contains the main display orchestration logic, object type detection, and SNT-specific object handling.
- handle_display_errors(operation_name: str)[source]#
Decorator to handle common display operation errors.
- Parameters:
operation_name (str) – Name of the operation for error messages
- Return type:
decorator function that handles exceptions
- display(obj: Any, show: bool = True, **kwargs) Any[source]#
Display any supported object type in the most appropriate way.
Handles Java objects, SNT objects, matplotlib figures, xarray objects, Viewer2D/3D objects, and lists. Automatically converts Java objects and creates multi-panel displays for lists.
- Parameters:
obj (Any) – Object to display (Java objects, SNTObjects, matplotlib figures, xarray objects, Viewer2D/3D objects, lists, etc.)
show (bool, default True) – Whether to display the figure immediately. If False, creates the figure but doesn’t show it (useful for chaining: fig1 = pysnt.display(obj, show=False))
**kwargs – Display arguments including: - cmap: str, colormap for grayscale images - title: str, display title - figsize: tuple, figure size - orthoview: bool, for 3D viewers - panel_layout: str, layout for multi-panel displays - max_panels: int, maximum panels to display - origin: str, origin for image display (‘upper’, ‘lower’, ‘auto’)
- Returns:
Return value depends on input type
- Return type:
Any