playnano.gui.window module¶
Main GUI window for browsing and exporting HS-AFM image stacks.
Provides: - Frame playback controls (play/pause, slider, FPS). - Raw vs. processed toggling and filter application. - Z-scale histogram with draggable range lines. - Export tabs for GIF, NPZ, OME-TIFF, HDF5.
- class playnano.gui.window.MainWindow(afm_stack: AFMImageStack, processing_steps: list[tuple[str, dict]] | None = None, output_dir: str | None = None, output_name: str = '', scale_bar_nm: int = 100, zmin: str = 'auto', zmax: str = 'auto', cmap: str = 'afm_brown', fps: float = 5.0)[source]¶
Bases:
QMainWindowMain window for the playNano GUI application.
- apply_filters()[source]¶
Apply the selected processing pipeline to the AFM stack.
Builds a ProcessingPipeline from self.processing_steps (or defaults), runs it, updates the flattened data (self._flat), recomputes display ranges, and refreshes the viewer.
- Return type:
None
- Raises:
RuntimeError – If the processing pipeline fails.
- keyPressEvent(ev)[source]¶
Handle key press events for shortcuts.
- Parameters:
ev (QKeyEvent) – The key event to handle.
- Return type:
None
- Raises:
None –
Notes
Key mapping: Space → toggle play/pause F → apply filters R → toggle raw/processed view G → export GIF E → export data in checked formats
- show_frame(idx: int)[source]¶
Render a specific frame in the viewer.
- Parameters:
idx (int) – Index of the frame to display (raw or processed, depending on state).
- Return type:
None
- Raises:
IndexError – If idx is out of bounds.
- staticMetaObject = PySide6.QtCore.QMetaObject("MainWindow" inherits "QMainWindow": )¶