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

Annotation - select range of track with shortcut keys #514

Open
ShrimpCryptid opened this issue Jan 8, 2025 · 6 comments · May be fixed by #561
Open

Annotation - select range of track with shortcut keys #514

ShrimpCryptid opened this issue Jan 8, 2025 · 6 comments · May be fixed by #561
Labels
new feature New feature or request

Comments

@ShrimpCryptid
Copy link
Contributor

Use Case

Requested by @SergeEParent! Scientists want to be able to label ranges of a track

Acceptance Criteria

  • In annotation edit mode, holding shift will select a range of objects in a track from last time it was selected to the current frame.
    • The flow would work like: Select a cell in a track on a certain frame, then jump forward by some number of frames, hold shift, and click the same track again.
  • A popup should appear when hovering over the new cell ("Select track {T} from frame {T0} to frame {T1}").

Details

  • Store the last object that a label was applied to (null if a label was last removed from an object).
  • Check if the currently hovered object and the last object have the same track ID.
@ShrimpCryptid
Copy link
Contributor Author

ShrimpCryptid commented Jan 31, 2025

This request was also echoed by @jessicasyu in our show & tell meeting!

Her vision (before knowing about this ticket) was to have an additional mode besides time and track that selects ranges, and that you could click one timepoint and then another to select the whole range. She said it is useful for events that aren't just a single frame (ex: mitosis).

@toloudis
Copy link
Contributor

How will a user know they have shift-clicked on something that is actually on the same track as the previous click? What happens if they don't? This seems like the tricky part to make it obvious and easy...

@ShrimpCryptid
Copy link
Contributor Author

How will a user know they have shift-clicked on something that is actually on the same track as the previous click? What happens if they don't? This seems like the tricky part to make it obvious and easy...

I described having a popup/ghost hover message at the bottom of the viewport describing what would happen in the acceptance criteria:

"Label XXX objects from frame Y to frame Z"
"Remove label from XXX objects from frame Y to frame Z"

I do think I'd have to tinker with this a bunch too to make sure the behavior matches user expectations. What happens if you removed the label from the last object you clicked on, but you move frames and then hover over an unlabeled object in the same track? Does it re-select the first object? Only the objects after the first?

t=0, last interaction with object is t=15, new hovered object is Expected behavior on shift + click
Add label Unlabeled Labels all objects from t=0 to t=15
Remove label Labeled Remove labels from all objects from t=0 to t=15
Add label Labeled ?: Remove labels from objects from t=0 to t=15? Only from t=1?
Remove label Unlabeled ?: Add labels from objects from t=0 to t=15? Only from t=1?

@SergeEParent
Copy link

Could you make something like the following?:

  1. click on object in track "X" at timeframe "T" -> object is outlined and highlighted with some color (e.g. red, yellow, etc.)
  2. move to some arbitrary timeframe "T + n" later in the timelapse -> objects in that track remains outlined but are not highlighted
  3. shift+click on outlined object (i.e. object that is still part of the previously-clicked-on track "X") -> all objects that are part of track "X" between and including timeframe "T" and timeframe "T + n" go from being outlined to being outlined and highlighted
  4. move back to some timeframe between timeframe "T" and "T + n" and notice that you want to exclude an object at that timeframe from track "X"
  5. ctrl+click on object that is outlined + highlighted causes it to just be outlined and not highlighted. If ctrl+click on it again it goes back to being outlined and highlighted.

i.e. once an object in a track is clicked on all objects in that track at all timepoints are outlined, and the object at the specific timepoint is both outlined and highlighted; shift+click toggles between highlighting / unhighlighting all objects between the previously highlighted object in that track and the current object in that track; ctrl+click toggles between highlighting / unhighlighting objects at specific timepoints in that track.

@ShrimpCryptid
Copy link
Contributor Author

Thanks for the input, Serge! I made a quick edit to terminology to match the language we currently use to describe annotation.

Could you make something like the following?:

  1. click on object in track "X" at timeframe "T" -> object is selected and annotated with some color (e.g. red, yellow, etc.)
  2. move to some arbitrary timeframe "T + n" later in the timelapse -> objects in that track remain selected but are not annotated
  3. shift+click on selected object (i.e. object that is still part of the previously-clicked-on track "X") -> all objects that are part of track "X" between and including timeframe "T" and timeframe "T + n" go from being selected to being selected and annotated
  4. move back to some timeframe between timeframe "T" and "T + n" and notice that you want to exclude an object at that timeframe from track "X"
  5. ctrl+click on object that is selected + annotated causes it to just be selected and not annotated. If ctrl+click on it again it goes back to being selected and annotated.

i.e. once an object in a track is clicked on all objects in that track at all timepoints are selected, and the object at the specific timepoint is both selected and annotated; shift+click toggles between annotating / unannotating all objects between the previously annotated object in that track and the current object in that track; ctrl+click toggles between annotating / unannotating objects at specific timepoints in that track.

This makes sense to me, and I like that you can shift + click multiple times to toggle annotating/un-annotating.

I'll have to think about what you're describing with the Ctrl+Click behavior-- currently, regular clicking both selects and annotates a track, and I can see why a user would want to select WITHOUT annotating. Maybe we should consider gating annotation behind a modifier key? (or the inverse where, in annotation edit mode, clicking with a modifier key held down just gives you the regular click behavior.)

@SergeEParent
Copy link

Maybe you could make it so that clicking alone will select without annotation, and ctrl+click or shift+click will annotate? I guess ctrl and shift would be the modifier keys in that case.

@ShrimpCryptid ShrimpCryptid linked a pull request Feb 7, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants