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

Mask color array #65

Closed
wants to merge 3 commits into from
Closed

Conversation

manics
Copy link
Member

@manics manics commented Aug 18, 2020

See #62
Converts the label-color dict to an array or colours.

Also require the labels to be integers

See also an alternative in #68

the `color` key is another JSON object in which the key is the pixel value of the image and
the value is an RGBA color (4 byte, `0-255` per channel) for representing the object:
the `color` key is a JSON array in which the index is the pixel value of the image and
the value is an RGBA color (4 byte, `0-255` per channel) for representing the object, or `null` if no color is set:
Copy link
Member Author

Choose a reason for hiding this comment

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

We should say something about how the 4-bytes are converted to a single int, e.g. signed/unsigned, big/little endian

@mtbc
Copy link
Member

mtbc commented Aug 18, 2020

Note that the microservice uses ROI IDs as pixel values for overlapping masks.

@manics
Copy link
Member Author

manics commented Aug 18, 2020

I thought it was going to use a sentinal value e.g. -1 or max-int?

@joshmoore
Copy link
Member

That's masks per ROI rather than two overlapping ROIs. To reduce the ambiguity, using the ROI ID everywhere might be safer (Rois and Masks could have the same ID).

@manics
Copy link
Member Author

manics commented Aug 18, 2020

Using ROI-IDs instead of integer labels makes it easy for omero-ms-zarr and other utilities to export the mask from OMERO, but it means a user has to map each ROI-id to a label-index if they want a traditional label image.

@mtbc
Copy link
Member

mtbc commented Aug 18, 2020

It would be easy to make that configurable. It would be possible to wholly prohibit offering ROI ID pixel values, I'd naively guess that the ROI→index lookup would be fast, but if their code is thinking in OMERO ROIs then of course they have to map the indices back to the ROIs.

@manics
Copy link
Member Author

manics commented Aug 18, 2020

@joshmoore
Copy link
Member

Closed in favor of #71

@joshmoore joshmoore closed this Sep 15, 2020
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.

3 participants