Skip to content
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

Merged
merged 8 commits into from
Jul 17, 2020
Merged

First version of mask metadata #55

merged 8 commits into from
Jul 17, 2020

Conversation

spec.md Show resolved Hide resolved
spec.md Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved
@joshmoore
Copy link
Member Author

Changes pushed, @manics. Thanks.

Copy link
Member

@manics manics left a 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.

spec.md Outdated Show resolved Hide resolved
"1": 8388736,
...
```

Copy link
Member

@manics manics Jul 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### "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"
}
}
```

Copy link
Member

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

spec.md Show resolved Hide resolved
spec.md Outdated Show resolved Hide resolved

### "color"

The `color` key defines an image that is "labeled", i.e. every unique value in the image
Copy link
Member

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.

Copy link
Member Author

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 ;)

Copy link
Member

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.

@jburel
Copy link
Member

jburel commented Jul 9, 2020

Discussed this morning with @will-moore and @manics, we need to indicate the resolution the mask corresponds to.
I have been looking at large images (bdv from IDR), and did some segmentation on resolution 4 then saving the segmented planes. The description for mask should probably indicate the source image/resolution so when we load the mask only, we know what to load next if required.

@joshmoore joshmoore changed the title Initial draft of mask metadata First version of mask metadata Jul 10, 2020
@joshmoore
Copy link
Member Author

@manics Also happy to open this as a separate PR after this is merged.

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.

@joshmoore
Copy link
Member Author

the need to indicate the resolution...

see c15b68b

├── .zattrs # "color".
└── t.c.z.y.x # Chunks as above.
├── .zarray # Each mask itself is a 5D array matching the highest resolution
Copy link
Member

@jburel jburel Jul 10, 2020

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

Copy link
Member Author

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.

Copy link
Member

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

Copy link
Member

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?

spec.md Show resolved Hide resolved
@mtbc
Copy link
Member

mtbc commented Jul 15, 2020

@mtbc mtbc mentioned this pull request Jul 16, 2020
Co-authored-by: Simon Li <[email protected]>
Copy link
Member

@sbesson sbesson left a 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
Copy link
Member

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?

@sbesson sbesson merged commit e6ccb16 into ome:master Jul 17, 2020
@joshmoore joshmoore deleted the masks-etc branch July 23, 2020 16:23
@joshmoore
Copy link
Member Author

#55 (comment) Discussed this morning with @will-moore and @manics, we need to indicate the resolution the mask corresponds to.
I have been looking at large images (bdv from IDR)

hmm... @jburel: compare https://gist.github.com/jni/62e07ddd135dbb107278bc04c0f9a8e7 and let me know what you think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants