playnano.gui.main module

Main entry point for the playNano GUI application.

playnano.gui.main.ICON_SIZES: tuple[int, ...] = (16, 32, 48, 64, 128, 256, 512)

Pixel sizes of the bundled application icon PNGs. The 16 and 32 px icons are simplified, pixel-aligned versions of the logo; larger sizes use the full mark.

playnano.gui.main.WINDOWS_APP_ID = 'playnano.gui'

Windows taskbar identity for the GUI process (see _set_windows_app_id).

playnano.gui.main.gui_entry(afm_stack, output_dir=None, output_name='', steps_with_kwargs=None, scale_bar_nm=100, zmin='auto', zmax='auto', cmap='afm_brown', fps=5.0)[source]

Launch the playNano GUI with a given AFM stack and visualization/export settings.

Parameters:
  • afm_stack (AFMImageStack) – The AFM image stack to display and process.

  • output_dir (str or None, optional) – Directory in which to save exported files (default: None, which uses internal defaults).

  • output_name (str, optional) – Base filename for any exports (default: “” - this triggers the default behaviour when utils.io_utils.sanitize_output_name is called).

  • steps_with_kwargs (list of (str, dict) or None, optional) – A list of (filter_name, kwargs) tuples for the default processing pipeline. If None, the application’s built-in defaults are used.

  • scale_bar_nm (int, optional) – Physical length of the scale bar in nanometers (default: 100).

  • zmin (float, "auto", or None, optional) – Minimum height value for the initial colormap range. If “auto”, uses the 1st percentile of the data; if None, uses the data minimum; if a float, uses that value (default: “auto”).

  • zmax (float, "auto", or None, optional) – Maximum height value for the initial colormap range. If “auto”, uses the 99th percentile of the data; if None, uses the data maximum; if a float, uses that value (default: “auto”).

  • cmap (str, optional) – Name of the colormap to use for visualisation on launch (default=DEFAULT_CMAP).

  • fps (float, optional) – Initial frame rate for the GIF in frames per second (default=5.0).

Return type:

None

Notes

This function will start a Qt event loop and will not return to the caller.

playnano.gui.main.load_app_icon() → QIcon[source]

Build the playNano application icon from the bundled PNG files.

Each size is added separately so Qt picks the hand-tuned bitmap for small sizes (title bar, taskbar) instead of downscaling a large image.

Returns:

The application icon. It is null (QIcon.isNull()) if no icon files could be found, in which case a warning is logged.

Return type:

QIcon