A class to serve as a registry for all pretty picture manipulation
plugins.
This class should not be instantiated directly other than the one
instantiation in this module.
Examples
--------
Using this registry to create a plugin would look somehting like the
following.
>>> @plugins.register(1, PluginType.PARTIAL)
>>> def fixNoData(
>>> image: NDArray,
>>> mask: NDArray,
>>> maskDict: Mapping[str, int]
>>> ) -> NDArray:
>>> m = (mask & 2 ** maskDict["NO_DATA"]).astype(bool)
>>> for i in range(3):
>>> image[:, :, i] = cv2.inpaint(
>>> image[:, :, i].astype(np.float32),
>>> m.astype(np.uint8),
>>> 3,
>>> cv2.INPAINT_TELEA
>>> ).astype(image.dtype)
>>> return image
Parameters
----------
None
| Callable lsst.pipe.tasks.prettyPictureMaker._plugins.PluginsRegistry.register |
( |
| self, |
|
|
float | order, |
|
|
PluginType | kind ) |
Register a plugin which is to be run when producing a
pretty picture.
Parameters
----------
order : `float`
This determines in what order plugins will be run. For
example, if plugin A specifies order 2, and plugin B
specifies order 1, and both are the same ``kind`` of
plugin type, plugin B will be run before plugin A.
kind : `PluginType`
This specifies what data the registered plugin expects
to run on, a channel, a partial image, or a full mosaic.
Returns
-------
wrapper : `Callable`
Decorator function for registering the plugin.