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/Labeling Conversion Methods #45

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Mask/Labeling Conversion Methods #45

wants to merge 6 commits into from

Conversation

awalter17
Copy link
Contributor

Hello!

The goal of this PR is to add mechanisms for going between Labelings and MaskPredicates.

Changes this branch makes:

  • Adds LabeledMaskInterval class, which wraps a MaskInterval and adds a label
  • Adds methods to go from Labeling to MaskInterval
  • Adds methods to go from List< MaskInterval > to ImgLabeling

Notes:

  • Currently there's only LabeledMaskInterval because there's no unbounded or real-space labelings
  • Labeling to MaskInterval methods just wrap LabelRegions as MaskIntervals then as LabeledMaskIntervals
  • MaskInterval to ImgLabeling rasters MaskInterval to the provided ImgLabeling, which means the conversion is not fully reversible (i.e. you can go back to a MaskInterval but information has been lossed)
  • MaskInterval to ImgLabeling methods will recurse through CompositeMaskPredicates, so if the root MaskInterval isn't a LabeledMaskInterval but the children are those labels will be added to the ImgLabeling. However, the labels will only be added at locations contained in the root MaskInterval
    • One method ignores MaskIntervals which are not LabeledMaskIntervals even if they're part of a CompositeMaskInterval. Meaning you could have a MaskInterval which is an "or" of one labeled and unlabeled mask, and only the labeled mask will appear in the ImgLabeling.
    • The second method allows you to set a "default label" so if there are any unlabeled pixels in a ROI this default label will be used

Please let me know if you have any questions, or if any changes are necessary!

@ctrueden
Copy link
Member

Rebased over latest master to fix conflicts.

@ctrueden
Copy link
Member

ctrueden commented Nov 9, 2019

@awalter17 Do you need this for KNIME? I vaguely recall you mentioning work along these lines for KNIME back in September. Should we prioritize merging this?

@stelfrich
Copy link

@ctrueden If I am not mistaken, @awalter17 had invested some more time after discussions we had about KNIME's OMERO integration. @gab1one's implementation to read ROIs from OMERO is a little suboptimal and should be handled upstream..

@awalter17
Copy link
Contributor Author

@ctrueden thanks for fixing the conflicts! It would be nice to get this merged, because I am starting forget what I did and why. However, I don't think this merge is currently blocking anyone. So I would say this merge is "nice to have", but not immediately critical.

As @stelfrich mentioned, this PR came out of discussions about KNIME's OMERO integration. As I recall, KNIME currently uses Labelings for ROIs but ImageJ-OMERO uses MaskPredicate ROIs, so the KNIME OMERO integration currently lacks ROI support. This PR would be a first step towards ROI support in the KNIME OMERO integration.

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