Skip to content

Conversation

@naglepuff
Copy link
Collaborator

@naglepuff naglepuff commented Sep 22, 2025

Fix #201

Changes

Since the NABat spectrogram view has pulse level annotations disabled, there is no way to use the annotation tool to draw bounding boxes on the spectrogram to get rough time and frequency ranges for specific pulses in the image.

This functionality is now replaced in the NABat spectrogram view by a bounding box tool. With the tool, users can draw a box on to the spectrogram. Once the box is drawn, the start time, end time, minimum frequency, and maximum frequency are all displayed as labels around the box.

Users can also click the box to enter "edit mode" and adjust the height and width of the box. As users edit the box, the labels will update to reflect the changes to the values reported.

Video

bbox_tool.mp4

In this video I demonstrate using the bounding box tool. Users click the icon next to the ruler to enable drawing a box. Once the box is drawn, it can be moved using the edit handles provided by GeoJS. The labels update as the user edits the annotation. If the user draws the box such that it spans multiple pulses on a compressed view, a badge will appear on the icon, and the tooltip will change to a message explaining that the user has done this.

@BryonLewis I tried replacing the offset by just using x/y values, but the behavior with offset seemed to work better here. Not sure how big of a deal that is.

TODO:

  • Add video and screenshots to this PR description
  • Disable scaling/rotating the annotation

@naglepuff naglepuff force-pushed the issue-201-nabat-bounding-box branch from b109496 to f79b6ba Compare September 24, 2025 16:46
@naglepuff naglepuff force-pushed the issue-201-nabat-bounding-box branch from c3614db to 2d4a564 Compare September 24, 2025 19:46
@naglepuff naglepuff force-pushed the issue-201-nabat-bounding-box branch from 2d4a564 to 84fd520 Compare September 24, 2025 19:47
@naglepuff naglepuff changed the base branch from issue-201-measurement-tool to main September 24, 2025 19:52
@naglepuff naglepuff requested a review from BryonLewis October 2, 2025 14:48
@naglepuff naglepuff marked this pull request as ready for review October 2, 2025 14:48
Copy link
Collaborator

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

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

This looks good and functions like I would expect.

I noticed an issue that I think could be a separate PR. It has to do with making the measurement box go past the bounds of the image. There is a similar issue for Pulse Annotations (my fault) and drawing that box, so I figured it could be a separate PR where we address both. Most users should know if they are exceeding the bounds.
The new issue is #250

The second thing is that when zooming out (especially on uncompressed mode) the text alignment drifts significantly far from the box. I've created a PR that I believe addresses this #249. In that PR I've also included a video demonstrating the drifting and how the new version resolves it. Feel free to modify anything or correct items in that PR because I did it quickly. I've included the video here also for reference.

20251003-BatAI-MeasuringTextAlignment_small.mp4

* fix: adjust text alignment for measuring box

* remove duplicate visible declaration in Style types
@BryonLewis BryonLewis self-requested a review October 3, 2025 20:39
Copy link
Collaborator

@BryonLewis BryonLewis left a comment

Choose a reason for hiding this comment

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

👍

@naglepuff naglepuff merged commit 151d07d into main Oct 3, 2025
4 checks passed
@BryonLewis BryonLewis deleted the issue-201-nabat-bounding-box branch November 25, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NaBat Measurement tool

2 participants