-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #63 from BioImageTools/image-labels
Improve image-labels metadata
- Loading branch information
Showing
6 changed files
with
86 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"version": "0.4", | ||
"colors": [ | ||
{ | ||
"label-value": 1, | ||
"rgba": [255, 255, 255, 255] | ||
}, | ||
{ | ||
"label-value": 4, | ||
"rgba": [0, 255, 255, 128] | ||
} | ||
], | ||
"properties": [ | ||
{ | ||
"label-value": 1, | ||
"area": 1200, | ||
"cls": "foo" | ||
}, | ||
{ | ||
"label-value": 4, | ||
"area": 1650 | ||
} | ||
], | ||
"source": { | ||
"image": "../../" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
from tests.v04.conftest import read_in_json | ||
|
||
from ome_zarr_models.v04.image_label import Color, ImageLabel, Property, Source | ||
|
||
|
||
def test_image_label_example_json() -> None: | ||
model = read_in_json(json_fname="image_label_example.json", model_cls=ImageLabel) | ||
|
||
assert model == ImageLabel( | ||
colors=( | ||
Color(label_value=1, rgba=(255, 255, 255, 255)), | ||
Color(label_value=4, rgba=(0, 255, 255, 128)), | ||
), | ||
properties=( | ||
Property(label_value=1, area=1200, cls="foo"), | ||
Property(label_value=4, area=1650), | ||
), | ||
source=Source(image="../../"), | ||
version="0.4", | ||
) |