From 389135d5a925575f8d1372c57fbb5cd7b1409893 Mon Sep 17 00:00:00 2001 From: Florian M Date: Tue, 23 Jan 2024 13:46:12 +0100 Subject: [PATCH 1/2] Limit bbox of volume tracings to that of fallback layer --- CHANGELOG.unreleased.md | 1 + app/controllers/AnnotationIOController.scala | 3 ++- app/models/annotation/AnnotationService.scala | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index 5fec7d79271..d09f80db145 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -40,6 +40,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released - When no Email Address for New-User Notifications is configured, the organization owner will be notified. For overtime notifications, the project owner and the organization owner will be notified. [#7561](https://github.com/scalableminds/webknossos/pull/7561) - The metadata for ND datasets and their annotation has changed: upper bound of additionalAxes is now stored as an exclusive value, called "end" in the NML format. [#7547](https://github.com/scalableminds/webknossos/pull/7547) - Added support for the *index_location* parameter in sharded Zarr 3 datasets. [#7553](https://github.com/scalableminds/webknossos/pull/7553) +- When creating or uploading a non-task volume annotation layer with a fallback segmentation layer, the annotation layer’s bounding box will now be limited to that layer’s, instead of the whole dataset’s. [#7579](https://github.com/scalableminds/webknossos/pull/7578) ### Fixed - Datasets with annotations can now be deleted. The concerning annotations can no longer be viewed but still be downloaded. [#7429](https://github.com/scalableminds/webknossos/pull/7429) diff --git a/app/controllers/AnnotationIOController.scala b/app/controllers/AnnotationIOController.scala index 51ad028d6e3..9d29dfbc1a5 100755 --- a/app/controllers/AnnotationIOController.scala +++ b/app/controllers/AnnotationIOController.scala @@ -290,7 +290,8 @@ class AnnotationIOController @Inject()( case _ => None }.headOption val bbox = - if (volumeTracing.boundingBox.isEmpty) boundingBoxToProto(dataSource.boundingBox) + if (volumeTracing.boundingBox.isEmpty) + boundingBoxToProto(fallbackLayerOpt.map(_.boundingBox).getOrElse(dataSource.boundingBox)) else volumeTracing.boundingBox val elementClass = fallbackLayerOpt .map(layer => elementClassToProto(layer.elementClass)) diff --git a/app/models/annotation/AnnotationService.scala b/app/models/annotation/AnnotationService.scala index c4cdafb56e1..76fbfd69384 100755 --- a/app/models/annotation/AnnotationService.scala +++ b/app/models/annotation/AnnotationService.scala @@ -152,7 +152,7 @@ class AnnotationService @Inject()( } yield VolumeTracing( None, - boundingBoxToProto(boundingBox.getOrElse(dataSource.boundingBox)), + boundingBoxToProto(boundingBox.orElse(fallbackLayer.map(_.boundingBox)).getOrElse(dataSource.boundingBox)), System.currentTimeMillis(), dataSource.id.name, vec3IntToProto(startPosition.getOrElse(dataSource.center)), From 9eabeaf2e28811130959c2ddb17f4f87668cec35 Mon Sep 17 00:00:00 2001 From: Florian M Date: Tue, 23 Jan 2024 14:00:45 +0100 Subject: [PATCH 2/2] fix pr num --- CHANGELOG.unreleased.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.unreleased.md b/CHANGELOG.unreleased.md index d09f80db145..8fc952eed05 100644 --- a/CHANGELOG.unreleased.md +++ b/CHANGELOG.unreleased.md @@ -40,7 +40,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released - When no Email Address for New-User Notifications is configured, the organization owner will be notified. For overtime notifications, the project owner and the organization owner will be notified. [#7561](https://github.com/scalableminds/webknossos/pull/7561) - The metadata for ND datasets and their annotation has changed: upper bound of additionalAxes is now stored as an exclusive value, called "end" in the NML format. [#7547](https://github.com/scalableminds/webknossos/pull/7547) - Added support for the *index_location* parameter in sharded Zarr 3 datasets. [#7553](https://github.com/scalableminds/webknossos/pull/7553) -- When creating or uploading a non-task volume annotation layer with a fallback segmentation layer, the annotation layer’s bounding box will now be limited to that layer’s, instead of the whole dataset’s. [#7579](https://github.com/scalableminds/webknossos/pull/7578) +- When creating or uploading a non-task volume annotation layer with a fallback segmentation layer, the annotation layer’s bounding box will now be limited to that layer’s, instead of the whole dataset’s. [#7580](https://github.com/scalableminds/webknossos/pull/7580) ### Fixed - Datasets with annotations can now be deleted. The concerning annotations can no longer be viewed but still be downloaded. [#7429](https://github.com/scalableminds/webknossos/pull/7429)