Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Change
Use label ids as node ids in the candidate graph. This means that every label must have a unique id across time (and hypotheses). This PR adds a function to convert a segmentation with repeated labels to a segmentation with unique labels and changes the nodes from segmentation functions to use the label as the node id. All the test fixtures were updated to reflect this change.
Theoretically, the segmentation ID features is now redundant, since at graph creation we ensure that the node id matches the segmentation id. However, downstream code does not necessarily keep this invariant (e.g. if you relabel the segmentation, you don't necessarily [want to] relabel the node id, since this is essentially deleting the node and making a new one, along with updating all the incident edges). Therefore, for now, I left the segmentation ID in the graph, but it may be removed in the future once we examine downstream use cases.
Note: This is a breaking change (along with the multi-hypothesis API changes). We should update the major version after merging this PR, as all downstream code must be updated.
Checklist
Go through these things before merge. Actions should run automatically to test them, but for information on how to run locally, see CONTRIBUTING.md.