-
Notifications
You must be signed in to change notification settings - Fork 5
Add setting to allow labels to be dropped from input maps #35
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
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you just walk me through this? From what I gather, we are adding (in order):
overlay exceptions -> base inclusions -> overlay inclusions -> base exceptions?
I am guessing this results in some overwriting of the existing labels?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure:
split_labelsconsiders each unique label found in a label map. If that label is in the list ofdrops, it is ignored. If that label is in the list ofexclusions, it's split into a dataset that contains all the exclusion masks. Otherwise, it's split into a dataset that contains all the "regular" masks. (If there are no exceptions, only the dataset of "regular" masks is returned)So, after applying
split_labelsto the base and overlay input label maps, we have a base dataset, an overlay dataset, and maybe a base exclusions dataset and/or overlay exclusion dataset.We then pass a list of those datasets in the priority order you identified (overlay exceptions (if applicable) -> base regular -> overlay regular -> base exceptions (if applicable)) to
merge_labels, which reindexes all the label names that show up in the datasets, and writes the masks to an output 3D array with the new indices in order, so that later datasets overwrite labels written by earlier datasets.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good - I think there is still a potential fundamental concern about mixed labels for voxels within a region that don't overlap, but that was present prior to this. In any case, this PR looks good to merge to me.