Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Limit bbox of volume tracings to that of fallback layer #7580

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ For upgrade instructions, please check the [migration guide](MIGRATIONS.released
### Added

### Changed
- 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

Expand Down
3 changes: 2 additions & 1 deletion app/controllers/AnnotationIOController.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion app/models/annotation/AnnotationService.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down