From 41f947b134057decf3a8b6f95eff3d1fb761f466 Mon Sep 17 00:00:00 2001 From: Tom Herold Date: Thu, 27 Jun 2024 16:11:46 +0200 Subject: [PATCH] Add support for setting default mapping ID (#1118) * create an optional dependency group for wk-libs examples * remove nifti script to avoid sklearn dependency * fix optional marker * add default layer properties for mappings * changelog * Update webknossos/webknossos/dataset/properties.py --------- Co-authored-by: Florian M --- webknossos/Changelog.md | 1 + webknossos/webknossos/dataset/properties.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/webknossos/Changelog.md b/webknossos/Changelog.md index 6dc665e1b..325d758ef 100644 --- a/webknossos/Changelog.md +++ b/webknossos/Changelog.md @@ -19,6 +19,7 @@ For upgrade instructions, please check the respective _Breaking Changes_ section - Added a pixel level heuristic for distinguishing color and segmentation layers when importing image data with the `from_images` or `add_layer_from_images` method. [#1007](https://github.com/scalableminds/webknossos-libs/pull/1007) - Added .ims as supported suffix. [#1085](https://github.com/scalableminds/webknossos-libs/pull/1085) - Added suffixes supported by bioformats for Zeiss CZI, Leica LOF, Zeiss LSM (laser scanning microscope), Zeiss LSM (Laser Scanning Microscope) 510/710, Leica XLEF and Zeiss AxioVision ZVI (Zeiss Vision Image). [#1086](https://github.com/scalableminds/webknossos-libs/pull/1086) +- Added suport for setting a default ID mapping for segmentation layers. [1118](https://github.com/scalableminds/webknossos-libs/pull/1118) ### Changed - Moved functional parts of merge volume annotation CLI to Dataset and Annotation classes. [#1055](https://github.com/scalableminds/webknossos-libs/pull/1055) diff --git a/webknossos/webknossos/dataset/properties.py b/webknossos/webknossos/dataset/properties.py index 3eb583897..e4210e50f 100644 --- a/webknossos/webknossos/dataset/properties.py +++ b/webknossos/webknossos/dataset/properties.py @@ -113,6 +113,9 @@ class LayerViewConfiguration: is_in_edit_mode: Optional[bool] = None """Enable the histogram edit mode. The WEBKNOSSOS default is False.""" + mapping: Optional[Dict[str, str]] = None + """Enables ID mapping for a segmentation layer and applies the selected mapping by default. The default WK behavior is to disable ID mapping. Expected values is a Dict with {"name": my_mapping_name, "type": "HDF5"}.""" + # --- Property --------------------