Skip to content

Plugin mechanism for layers also provides GUI elements #8

@royerloic

Description

@royerloic

The concept of layer is a pairs (data,visual).
'data' being a data object (image, points, lines,etc)
and the corresponding 'visual' that represents visually
this object as a layer in Napari. Since we want to have sliders and
buttons that control how layers are displayed (min, max, gamma, etc).
It makes sense to provide a path for adding these elements in
a modular way as part of the 'layer registration' so that no hacking
of the UI code would be required for new layers needing new controls
such as sliders... etc...

We can discuss how to do this elegantly without introducing complexity.
I see two main approaches:

i) declarative: layer plugins declaratively specify what we want and it is created for them.
Pro: very clean. Con: can become very complicated because we essentially create a layer to pyQt.

ii) hook-based: we provide entry points and 'receptacles' for the PyQt objects created by the plugin side. For example, controls can be added on all three sides, or attached to each layer list item, etc...
Note: values from existing controls (alpha, brightness) can be used by any layer if they want to...
Pro: much more scalable and all features of pyQt are accessible. Con: reduced encapsulation as we give indirect access to much of the UI.

I thinks scalability wins. Option (ii) is simpler, more scalable, relies on a direct access to a solid api (pyQT), and can be clean if we provide well defined 'receptacles' for dropping the UI elements .

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions