organoid_tracker.visualizer package
Submodules
- organoid_tracker.visualizer.abstract_editor module
- organoid_tracker.visualizer.abstract_image_visualizer module
- organoid_tracker.visualizer.beacon_editor module
- organoid_tracker.visualizer.cell_compartment_visualizer module
- organoid_tracker.visualizer.cell_death_visualizer module
- organoid_tracker.visualizer.cell_density_visualizer module
- organoid_tracker.visualizer.cell_division_visualizer module
- organoid_tracker.visualizer.cell_fate_visualizer module
- organoid_tracker.visualizer.cell_movement_visualizer module
- organoid_tracker.visualizer.cell_segmentation_editor module
- organoid_tracker.visualizer.debug_image_visualizer module
- organoid_tracker.visualizer.division_score_visualizer module
- organoid_tracker.visualizer.empty_visualizer module
- organoid_tracker.visualizer.errors_visualizer module
- organoid_tracker.visualizer.exitable_image_visualizer module
- organoid_tracker.visualizer.image_offset_editor module
- organoid_tracker.visualizer.image_slice_visualizer module
- organoid_tracker.visualizer.lineage_errors_visualizer module
- organoid_tracker.visualizer.lineage_fate_visualizer module
- organoid_tracker.visualizer.lineage_tree_visualizer module
- organoid_tracker.visualizer.link_and_position_editor module
- organoid_tracker.visualizer.link_score_visualizer module
- organoid_tracker.visualizer.position_in_rectangle_selector module
- organoid_tracker.visualizer.position_list_visualizer module
- organoid_tracker.visualizer.spline_editor module
- organoid_tracker.visualizer.standard_image_visualizer module
- organoid_tracker.visualizer.track_visualizer module
Module contents
OrganoidTracker is centered around a Matplotlib window, and that window is controlled here.
Each screen in OrganoidTracker inherits from the Visualizer class, which just shows an empty Matplotlib plot. The
subclasses show more interesting behaviour, like
AbstractImageVisualizer
which shows an image from your
time-lapse movie, with the positions and links drawn on top.
If you want to create your own screeen, I would recommend that you create a subclass from ExitableImageVisualzer:
>>> from organoid_tracker.visualizer.exitable_image_visualizer import ExitableImageVisualizer
>>> class YourVisualizer(ExitableImageVisualizer):
>>> def get_extra_menu_options(self) -> Dict[str, Any]:
>>> return { "My menu//Some option": self._clicked_my_menu_option }
>>>
>>> def _clicked_my_menu_option(self):
>>> self.update_status("Clicked on my menu option!")
>>>
>>> def _on_position_draw(self, position: Position, color: str, dz: int, dt: int) -> bool:
>>> if dt == 0 and dz == 0:
>>> self._ax.text(position.x, position.y, "Some text") # Draws some text at the positions
>>> return True # Change this to False to no longer draw the original marker
- class organoid_tracker.visualizer.Visualizer(window: Window)
Bases:
object
A complete application for visualization of an experiment
- attach()
Attaches all event handlers.
- detach()
Detaches the event handlers.
- draw_view()
Draws the view.
- static get_closest_position(positions: Iterable[Position], x: Optional[int], y: Optional[int], z: Optional[int], time_point: Optional[TimePoint], max_distance: int = 100000)
Gets the position closest ot the given position. If z is missing, it is ignored. If x or y are missing, None is returned.
- get_default_status() str
Gets the status normally used when moving between time points or between different visualizers. Use update_status to set a special status.
- reconstruct_image(time_point: TimePoint, z: int, rgb_canvas_2d: ndarray)
Draws all positions and shapes to the given canvas. The canvas must be a float array, and will be clipped from 0 to 1.
Only called if self._should_show_image_reconstruction returns True.
- reconstruct_image_3d(time_point: TimePoint, rgb_canvas_3d: ndarray)
Draws all positions and shapes to the given canvas. The canvas must be a float array, and will be clipped from 0 to 1.
- refresh_all()
Redraws the view after loading the images.
- refresh_data()
Redraws the view.
- run_async(runnable: Callable[[], Any], result_handler: Callable[[Any], None])
Creates a callable that runs the given runnable on a worker thread.
- organoid_tracker.visualizer.activate(visualizer: Visualizer) None