-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First version of mask metadata #55
Conversation
Co-authored-by: Simon Li <[email protected]>
Co-authored-by: Simon Li <[email protected]>
Changes pushed, @manics. Thanks. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an image reference as a suggestion
https://github.com/ome/omero-cli-zarr/blob/184ddf4b6d7848895a281d7e997c808b76d1b97d/src/omero_zarr/masks.py#L172-L173
Also happy to open this as a separate PR after this is merged.
"1": 8388736, | ||
... | ||
``` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
### "image" | |
The `image` key is an optional dictionary which contains information on the image the mask is associated with. | |
If included it must include a key `array` whose value that is either: | |
- A relative path to a Zarr image array, for example: | |
``` | |
{ | |
"image": { | |
"array": "../../0" | |
} | |
} | |
``` | |
- A URL to a Zarr image array (use this if the mask is stored seperately from the image Zarr), for example: | |
``` | |
{ | |
"image": { | |
"array": "https://s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr/0" | |
} | |
} | |
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also open discussion at ome/omero-cli-zarr#19 (comment) about the specification of the image
key
|
||
### "color" | ||
|
||
The `color` key defines an image that is "labeled", i.e. every unique value in the image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also export color with style=--split
. The mask only has 1
values (not labelled) but it does have a color.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm.... reading it, I'm not sure just having only one label makes something not labeled. The example also only shows one value ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, so both --style=labelled
and --style=split
produce masks that are labelled. Maybe this is a bit less confusing if we ignore the --style=labelled
option (since that is the default). If we also consider removing the non-compliant 6d
option then all masks are "labelled". Are any masks NOT "labelled"? So I think you can remove that whole sentence "The color
key defines an image that is labeled, i.e. every unique value in the image represents a unique, non-overlapping object within the image." since even without any 'color', that statement is still true.
Discussed this morning with @will-moore and @manics, we need to indicate the resolution the mask corresponds to. |
If you don't mind, let's go for that. You can take the reins on a next round of PRs without all mine to get in your way while I'm gone. |
see c15b68b |
Co-authored-by: Simon Li <[email protected]>
├── .zattrs # "color". | ||
│ | ||
└── t.c.z.y.x # Chunks as above. | ||
├── .zarray # Each mask itself is a 5D array matching the highest resolution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that means that we won't be able to store masks generated at a different resolution
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not yet, no. But then ome-zarr-py code likely wouldn't support that either, nor omero-cli-zarr that output. Let's file that as an issue on one or several of the repositories and then we can work through the implications. I'm trying to get this PR into a state that it can be merged before I leave so no one is blocked on me.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
understood.
mainly a problem I am facing with the large DBV files that I have been segmenting at a resolution that is not the highest one but we can have that in another round
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jburel can you file an issue about the mask resolutions?
Co-authored-by: Simon Li <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks all for the contributions. Merging as soon as Travis is green to have a reference point for the 0.1.3 version of the spec
├── .zattrs # "color". | ||
│ | ||
└── t.c.z.y.x # Chunks as above. | ||
├── .zarray # Each mask itself is a 5D array matching the highest resolution |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jburel can you file an issue about the mask resolutions?
hmm... @jburel: compare https://gist.github.com/jni/62e07ddd135dbb107278bc04c0f9a8e7 and let me know what you think. |
see also: