Skip to content

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

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

Merged
merged 7 commits into from
May 19, 2025

Conversation

fm3
Copy link
Member

@fm3 fm3 commented Jan 23, 2024

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.

URL of deployed dev instance (used for testing):

Steps to test:

  • On a datast with a segmentation layer that is smaller than the color layer,
  • Create a volume annotation with fallback segmentation (is the default)
  • bbox should be limited to fallback layer’s
  • should still look the same after download + reupload
  • Note that the frontend does not currently “respect” the volume tracing’s bbox. This is fixed in Don't label outside of layer's bbox #8602 – it might make sense to test both PRs together

Issues:


@fm3 fm3 self-assigned this Jan 23, 2024
@fm3
Copy link
Member Author

fm3 commented Jan 23, 2024

The backend part of this works now, frontend logging shows that the bbox in the volumetracing proto object is set to the fallback layer bbox. However, I noticed a few strange effects in the frontend

  • If a skeleton layer exists also, the volume layer bbox is not shown and the brushing is not restricted to the volume layer bbox
  • If a skeleton layer does not exist, the volume layer bbox is shown, but you can still brush outside of it, but only unto the next bucket border
  • Related: segmentation data is rendered (also in dataset view mode) unto the next bigger bucket border (I reduced the segmentation layer bbox in the datasource-properties.json but didn’t delete the actual data outside of it)

@philippotto can you estimate if these points would be easy to fix in the frontend? If not, maybe I’d defer the issue again (I just thought it would be a quick change in the backend). But this particular behavior is pretty weird and unexpected.

@philippotto
Copy link
Member

If a skeleton layer exists also, the volume layer bbox is not shown and the brushing is not restricted to the volume layer bbox
If a skeleton layer does not exist, the volume layer bbox is shown, but you can still brush outside of it, but only unto the next bucket border

Regarding the differing visibility of the volume bbox, I'd have to investigate why this is the case.
That brushing is possible outside of the bbox (until the next bucket border) is known (see #6303) and requires a bit of thought. Not super complicated, but also not a 3-line-change.

segmentation data is rendered (also in dataset view mode) unto the next bigger bucket border (I reduced the segmentation layer bbox in the datasource-properties.json but didn’t delete the actual data outside of it)

This is also known (see #5775). Each layer's bbox needs to be passed into the shader and then be handled accordingly.

Both issues together might take approx. 2 hours ™️.

@fm3
Copy link
Member Author

fm3 commented Jan 24, 2024

Thanks for investigating! I think it would be worth tackling these two to three issues, but it certainly does not have the highest priority. I guess I’ll let this PR lie here until someone of the frontend team has some free capacity :)

@fm3 fm3 changed the title Limit bbox of volume tracings to that of fallback layer WIP: Limit bbox of volume tracings to that of fallback layer Jan 24, 2024
Copy link
Contributor

coderabbitai bot commented Mar 20, 2025

📝 Walkthrough

"""

Walkthrough

The changes update the logic for assigning bounding boxes to annotation layers during creation or upload. Now, if a fallback segmentation layer exists, its bounding box is used for the annotation layer instead of the dataset’s bounding box. This adjustment is reflected in both the controller and service layers, with no public API changes.

Changes

Files Change Summary
CHANGELOG.unreleased.md Added a changelog entry describing the new bounding box handling for annotation layers with fallback segmentation layers.
app/controllers/AnnotationIOController.scala, app/models/annotation/AnnotationService.scala Modified logic to prefer the fallback layer’s bounding box over the dataset’s when adapting properties or creating volume tracing.

Assessment against linked issues

Objective (Issue #) Addressed Explanation
Use fallback segmentation layer’s bounding box for annotation layers when present (#7365)

Suggested reviewers

  • philippotto

Poem

Bounding boxes shift and hop,
No longer dataset-wide, they stop—
At fallback layers, snug and neat,
Annotation bounds now complete.
A rabbit cheers this bounding fix,
🐇✨—code that’s clever, code that clicks!
"""

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 203193b and 2b7b941.

📒 Files selected for processing (1)
  • CHANGELOG.unreleased.md (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • CHANGELOG.unreleased.md
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: frontend-tests
  • GitHub Check: build-smoketest-push
  • GitHub Check: backend-tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@fm3 fm3 changed the title WIP: Limit bbox of volume tracings to that of fallback layer Limit bbox of volume tracings to that of fallback layer May 19, 2025
@fm3 fm3 marked this pull request as ready for review May 19, 2025 09:35
@fm3 fm3 requested a review from MichaelBuessemeyer May 19, 2025 09:36
Copy link
Contributor

@MichaelBuessemeyer MichaelBuessemeyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good as well and seems to work (at least it did during my testing)

@fm3 fm3 enabled auto-merge (squash) May 19, 2025 13:17
@fm3 fm3 merged commit 27ef183 into master May 19, 2025
5 checks passed
@fm3 fm3 deleted the volume-fallback-bbox branch May 19, 2025 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create annotation layer with fallback layer: keep layer bbox
3 participants