Skip to content
Rob Campbell edited this page Jun 18, 2019 · 6 revisions

Getting started

New plugins are easy to create as they are written completely in Python. A number of tutorial plugins are included to show how a plugin can modify the behavior of Lasagna or stream data from the main application it to a plugin window. Note also that other than the methods to load a new base stack, all other file loading methods (such the plot overlay loader) are plugins too. This makes it easy to load data in new ways without needing to modify the core code. Similarly, see the IO modules where data classes such as imagestack are defined.

How plugins integrate into Lasagna

When Lasagna starts the Lasagna class handles integration of plugins.

The hooks property contains a dictionary which allows plugin methods to be run at the start or end of one of the methods in the Lasagna. For example, Lasagna.updateMainWindowOnMouseMove runs continuously as the mouse moves over a figure window. It updates the cross hairs and the status bar. The dictionary key updateMainWindowOnMouseMove_End contains a value which is a list of methods to run once the cross hairs and status bar have been updated. The add_line_plugin has a method called hook_updateMainWindowOnMouseMove_End meaning that this this method will run at this point.