fix(imageOutline): fix the bug where outline was not showing without filling #3013
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.
Context
The labelmap outline in the volume/image mapper used the condition
tColor.a > 0.01
to improve performance by skipping the background. However, this meant that we couldn't render the outline when the fill is 0 (or a small number).You can see the bug here in this code sand boxI changed the logic to not rely on that and only work on segment Index.
Results
Now we can render them fine if the opacity is set to 0
Changes
Changed the logic of outline detection to not rely on the color opacity but rather the segment index itself.
PR and Code Checklist
npm run reformat
to have correctly formatted codeTesting