-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow custom colors for volume annotation segments (#6372)
* [WIP] allow custom colors for volume annotation segments * pretty * include color in segment update actions * fix compile errors * backend tests * set color to none if no color was included in the update action * Custom segment colors with cuckoo hashing (#6417) * resurrect cuckoo table implementation * adapt CuckooTable to entries consisting of (number, vec3) and finish proof-of-concept for writing and reading that hash table for segment colors * fall back to old color generation if custom color could not be looked up * add UI to select segment color * correctly save segment color to back-end * hook up custom segment colors from store with texture * improve performance of cuckoo updates * fix isDisabled prop for interpolation button * convert usage of vec4 color to vec3 * remove type property for uniforms since it's not needed anymore since three r76 * adapt tests to new cuckootable interface * clean up a bit * fix cuckoo tests by using broader value range for tests and using uint32array instead of float * try to get uint32 texture working (int texture only works when defined as byte, but that will clip values to 8 bit) * dirty proof of concept for uint32 texture * restore custom color rendering * fix tests * DRY mocks in tests * more clean up * implement unset for cuckoo table to allow resetting a segment color * extend tests a bit * don't hardcode values for cuckoo shader code * fix linting * also show segment patterns for custom segment colors * show correct colors (even when mapped) in segment list * also use correct color for mesh and synchronize the mesh with the segment color * fix linting * clean up some typing * make custom segment colors compatible with multiple segmentation layers * fix linting * fix segment color icon for non-tracing layers * don't allow changing colors for segments of non-tracing segmentation layer * remove unused code for low-level texture setup * remove logging from cuckoo table implementation * clean up cuckoo_table.spec.ts * fix React does not recognize the prop on a DOM element. warning when opening context menu * don't rely on random IDs in merger mode * dont use the term color in the merger mode implementation as it is incorrect and confusing * remove shuffleColorOfCurrentTree functionality for merger mode (let's wait for user feedback to see whether this is really needed) * also reset stored representative when deleting last node of tree in merger mode * clean up some mapping related code * allow changing segment colors for non-tracing segmentation layers (necessary for json mappings); the colors won't be saved, though * use custom segment color feature when loading a mapping which defines hue values * clean up typing for withMappingActivationConfirmation * remove old custom color implementation for JSON mappings * remove attempt to integrate ACE editor * move the cuckoo table maintenance into the LayerRenderingManager to avoid redundant updates and ensure diffing with the correct segments * fix linting * fix that shader won't render when all volume layers are invisible (but at least one exists) * don't fill int texture with 255 by default * revert temporary changes in test.sh * skip shader tests which try to parse glsl 3000 syntax (and fail) * fix some tests by having isosurface-related sagas wait for the scene controller to be initialized (which doesn't happen in some tests); therefore fixing null access to the scene controller * skip mapping-related texture requirement test * fix that seeds were not initialized correctly when no segmentation is visible initially * explain why some glsl tests are skipped * remove isMappingSupported distinction and incorporate custom colors texture into rendering logic * fix skipped test in rendering logic spec * implement compaction for update segment UpdateActions * explain texture format etc better * clean up test * make getSegmentsForLayer non-nullable * fix shader tests by avoiding hex uint notation * explain isInt workaround * remove one window mock; enforce correct type of other window mock; remove lots of @ts errors * explain disabled logic * fix linting * fix linting * initialize color picker properly even when a custom segment color was not defined yet * don't share material for chunks of mesh, since the opacity has to be controlled individually for the loading animation * fix linting * fix crash when anchor position of segment is null * try to debug buggy restore * fix bug with repeated sets that caused a key to be appear multiple times; also add regression test * fix that mapping.mappingColors were still used in toolbar and segments tab; clean up * fix linting * avoid that all segments in segment list rerender when mouse is moved * make custom colors work when using setMapping via frontend API * add analytics for custom colors in setMapping * memoize diffing of segments; refactor memoization of diffing trees * add docs for segment list * remove obsolete type parameter for uniform Co-authored-by: Philipp Otto <[email protected]> Co-authored-by: Philipp Otto <[email protected]>
- Loading branch information
1 parent
b58497e
commit 8124079
Showing
66 changed files
with
1,497 additions
and
693 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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 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 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 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
Oops, something went wrong.