ome / ome/ngff

Clarify difference between image-label properties and colors

Open
#79 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
171
Forks
75
Avg merge
2d 3h
Merged PRs (30d)
20

Description

We are planning to replace our previous text-based image label description format with a new json-based format for better interoperability. NGFF's image-label is simple and flexible enough, so we could use it.

However, there is an odd separation of colors from all other properties.

Some grouping of properties could make sense, for example separating display properties (color, opacity, fill opacity, border width, border opacity, etc.), content (name, standard terminology, etc.), and derived data (measurements, classification results, etc.). However, it is hard to find justification for just singling out color.

Would you consider the following options to improve this data structure?

Option A. Move all properties under a single properties object

"image-label":
  {
    "properties": [
      { "label-value": 1, "name": "liver", "color": "0000FF", "opacity": 0.5, "area (pixels)": 1200, "class": "foo" },
      { "label-value": 4, "name": "tumor", "color": "00FF00", "opacity": 1.0, "area (pixels)": 1650 },
      ...
      ]
  },
  "source": {
    "image": "../../"
  }

Option B. Move properties under a few objects, such as properties and display; or properties, display, and measurements.

"image-label":
  {
    "version": "0.4",
    "properties": [
      { "label-value": 1, "name": "liver", "area (pixels)": 1200, "class": "foo" },
      { "label-value": 4, "name": "tumor", "area (pixels)": 1650 },
      ...
      ],
    "display": [
      { "label-value": 1, "color": "0000FF", "opacity": 0.5 },
      { "label-value": 4, "color": "00FF00", "opacity": 1.0 },
      ...
      ]
  },
  "source": {
    "image": "../../"
  }

or

"image-label":
  {
    "version": "0.4",
    "properties": [
      { "label-value": 1, "name": "liver" },
      { "label-value": 4, "name": "tumor" },
      ...
      ],
    "display": [
      { "label-value": 1, "color": "0000FF", "opacity": 0.5 },
      { "label-value": 4, "color": "00FF00", "opacity": 1.0 },
      ...
      ],
    "measurements": [
      { "label-value": 1, "area (pixels)": 1200, "class": "foo" },
      { "label-value": 4, "area (pixels)": 1650 },
      ...
      ]
  },
  "source": {
    "image": "../../"
  }

Note that I've changed the color definition from "rgba"=[255,255,255,255] to "color": "0000FF"match how it is defined elsewhere in NGFF.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the linked NGFF image-label specification and compare its current colors/properties structure with Options A and B in the issue. Resolve which grouping and color representation should be adopted, then update the specification; no repository files, tests, or entry points are identified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
json
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.