PYME.DSView.modules package

PYME.DSView.modules.allmodules()
PYME.DSView.modules.loadMode(mode, dsviewer)

install the relevant modules for a particular mode

PYME.DSView.modules.loadModule(modName, dsviewer)

Loads a module my calling that modules Plug() function.

The outputs = Plug(dsviewer) function takes an instance of the data viewer and optionally returns a module class (or classes) which should be programatically accessible as an attribute of the viewer. This return can either be an object (in which case it will be accessible under the plugin name) or a dictionary if multiple objects are being returned or if things should be available under a name other than the module name. The dictionary return is largely to support an easy transition from the old plugin naming and should be avoided in new code, using a wrapper class if more than one object needs to be accessed. In the future we might require the return to be a subclass of a Plugin object or similar.

Plugins should NOT inject themselves directly into the dsviewer namespace as has been done in the case in the past as this is likely to result in circular references.

if Plugins wish to keep track of the dsviewer object they are ascociated with (or it’s .image, .do or .view attributes) they should inherit from PYME.DSView.modules._base.Plugin which implements weak proxies of the above to avoid reference counting issues.

NOTE: the Plugin class and safe dsviewer injection of values returned by Plug() are only available in python-microscopy>=2020.07.07. Plugins planning to use these should either pin to python-microscopy>=2020.07.07 in their conda recipe or pip requirements, or handle old versions of PYME gracefully (e.g. by checking the PYME version and prompting users to update if needed).

Parameters
modName
dsviewer
Returns

Submodules