organoid_tracker.gui.window module

class organoid_tracker.gui.window.DisplaySettings(*, show_next_time_point: bool = False, show_images: bool = True, show_data_axes: bool = True, show_positions: bool = True)

Bases: object

Used for window-specific display settings.

KEY_SHOW_IMAGES = 'i'
KEY_SHOW_NEXT_IMAGE_ON_TOP = 'n'
error_correction_max_time_point: Optional[TimePoint] = None
error_correction_min_time_point: Optional[TimePoint] = None
image_channel: ImageChannel
max_intensity_projection: bool = False
segmentation_channel: Optional[ImageChannel]
show_errors: bool
show_images: bool
show_next_time_point: bool
show_positions: bool
show_splines: bool
time_point: TimePoint
z: int
class organoid_tracker.gui.window.Window(q_window: QMainWindow, figure: Figure, experiment: GuiExperiment, title_text: QLabel, status_text: QLabel)

Bases: object

The model for a window.

property display_settings: DisplaySettings
get_active_experiments() Iterable[Experiment]
get_experiment() Experiment

Gets the experiment that is being shown. Raises UserError if no particular experiment was selected.

get_figure() Figure

Gets the Matplotlib figure.

get_gui_experiment() GuiExperiment

Gets the GUI experiment, which stores the experiment along with undo/redo data, and some other non-saveable data.

get_scheduler() Scheduler
get_undo_redo() UndoRedo

Gets the undo/redo handler. Any actions performed through this handler can be undone.

perform_data_action(action: UndoableAction)

Performs an action that will change the experiment data. The action will be executed, then the window will be redrawn with an updated status bar.

property plugin_manager: PluginManager

Gets the plugin manager, allowing you to load, inspect and unload plugins.

redraw_all()

Redraws the image using the latest values from the experiment.

redraw_data()

Redraws the main figure using the latest values from the experiment.

register_event_handler(event: str, action: Callable)

Registers an event handler, whichs allows you to react on things like “data changed”. Supported events:

  • All matplotlib events.

  • All GuiExperiment event: GuiExperiment.KNOWN_EVENTS

Don’t forget to unregister your event handlers when its no longer needed! Otherwise you’ll have a memory leak.

property registry: Registry

Gets the registry. Used for plugin-provided things, like new cell types.

replace_plugin_manager(value: PluginManager)

Replaces the plugin manager. Can only be done if no plugins are loaded.

set_figure_title(text: str)

Sets the big text above the main figure.

set_status(text: str)

Sets the small text below the figure.

set_window_title(text: Optional[str])

Sets the title of the window, prefixed by APP_NAME. Use None as the title to just sown APP_NAME.

setup_menu(extra_items: Dict[str, any], *, show_plugins: bool)

Update the main menu of the window to contain the given options.

unregister_event_handlers()

Unregisters all handlers registered using register_event_handler