Open awalter17 opened 5 years ago
Rebased over latest master to fix conflicts.
@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?
@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..
@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 Labeling
s 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.
Hello!
The goal of this PR is to add mechanisms for going between Labelings and
MaskPredicate
s.Changes this branch makes:
LabeledMaskInterval
class, which wraps aMaskInterval
and adds a labelMaskInterval
List< MaskInterval >
toImgLabeling
Notes:
LabeledMaskInterval
because there's no unbounded or real-space labelingsMaskInterval
methods just wrapLabelRegion
s asMaskInterval
s then asLabeledMaskInterval
sMaskInterval
toImgLabeling
rastersMaskInterval
to the providedImgLabeling
, which means the conversion is not fully reversible (i.e. you can go back to aMaskInterval
but information has been lossed)MaskInterval
toImgLabeling
methods will recurse throughCompositeMaskPredicate
s, so if the rootMaskInterval
isn't aLabeledMaskInterval
but the children are those labels will be added to theImgLabeling
. However, the labels will only be added at locations contained in the rootMaskInterval
MaskInterval
s which are notLabeledMaskInterval
s even if they're part of aCompositeMaskInterval
. Meaning you could have aMaskInterval
which is an "or" of one labeled and unlabeled mask, and only the labeled mask will appear in theImgLabeling
.Please let me know if you have any questions, or if any changes are necessary!