Skip to content

Simplify the Object/Display/DisplayViewer type hierarchies #157

Open
@ctrueden

Description

@ctrueden

In conjunction with imagej/imagej-common#12, we want to rework how SciJava Displays are structured.

The status quo:

  • You have an Object, which gets wrapped in a (UI-agnostic) Display. Each Display is a list of such Objects, rather than only a single Object. To visualize that Display, you then need a UI-specific DisplayViewer, which actually shows the Display's contents to the user somehow.
  • In ImageJ, the type hierarchies are more complex: you have a Data, which is wrapped in a DataView (e.g., Dataset wrapped in DatasetView, or Overlay wrapped in OverlayView). Then an ImageDisplay, which is a type of Display for DataViews.

We can streamline this. Let's have instead:

  • View, which wraps an Object, and contains visualization settings. Subtypes of view (e.g., ImageView) implemented as needed to encapsulate the appropriate viz settings.
    • A ViewService handles wrapping of Objects to the most appropriate View.
    • In the case of images, there would be an ImageView which has a position (while its wrapped Dataset does not).
  • Display, which becomes a UI-specific thing used by the UIService.
    • In other words: DisplayViewer gets renamed to Display.
    • The old Display no longer exists—we only support a single View per Display.
    • We have a DefaultView that is used for Objects with no particular need for visualization settings.
  • To cover the need for multiple N-dimensional image objects (i.e., Datasets and Overlays) bagged together, we provide CompositeView, which composes a list of Views in a single composite space.

These changes would reduce the amount of names floating around—we would no longer need "viewers" but would only have Views and Displays. It would also help simplify the implementation of new UIs, at least from the perspective of understanding the execution flow.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions