Skip to content

Commit b9052bf

Browse files
authored
Use annotation-provided scale for temp volume annotation (#644)
* Update annotation.py * Update annotation.py * pr feedback * changelog * pr feedback
1 parent 61c4453 commit b9052bf

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

webknossos/Changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ For upgrade instructions, please check the respective *Breaking Changes* section
1717
### Added
1818

1919
### Changed
20+
- Annotation: `Annotation.temporary_volume_layer_copy` now uses the NML-provided `scale`. [#644](https://github.com/scalableminds/webknossos-libs/pull/644)
2021
- Dataset: Moved the deprecation warning from `get_color_layers()` to the actually deprecated method `get_color_layer()`.
2122
[#635](https://github.com/scalableminds/webknossos-libs/pull/635)
2223
- Inconsistent writes to datasets properties (e.g., caused due to multiprocessing) are detected automatically. The warning can be escalated to an exception with `warnings.filterwarnings("error", module="webknossos", message=r"\[WARNING\]")`. [#633](https://github.com/scalableminds/webknossos-libs/pull/633)

webknossos/webknossos/annotation/annotation.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -595,22 +595,21 @@ def temporary_volume_layer_copy(
595595
"""
596596

597597
with TemporaryDirectory() as tmp_annotation_dir:
598-
tmp_annotation_dataset_path = (
599-
Path(tmp_annotation_dir) / "tmp_annotation_dataset"
598+
input_annotation_dataset = Dataset(
599+
tmp_annotation_dir,
600+
name="tmp_annotation_dataset",
601+
scale=self.scale,
602+
exist_ok=True,
600603
)
601604

602-
input_annotation_dataset = Dataset(
603-
str(tmp_annotation_dataset_path), scale=(1, 1, 1), exist_ok=True
604-
)
605-
606-
input_annotation_layer = self.export_volume_layer_to_dataset(
607-
input_annotation_dataset,
608-
"volume_layer",
609-
volume_layer_name=volume_layer_name,
610-
volume_layer_id=volume_layer_id,
611-
)
605+
input_annotation_layer = self.export_volume_layer_to_dataset(
606+
input_annotation_dataset,
607+
"volume_layer",
608+
volume_layer_name=volume_layer_name,
609+
volume_layer_id=volume_layer_id,
610+
)
612611

613-
yield input_annotation_layer
612+
yield input_annotation_layer
614613

615614

616615
Annotation._set_init_docstring()

0 commit comments

Comments
 (0)