-
Notifications
You must be signed in to change notification settings - Fork 14
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
Masking boundaries #1569
Masking boundaries #1569
Conversation
Decouples the InteractiveTemplate class from the LLNL import tool so that it can be used more broadly across the application. The class can now accept a list of vertices in raw coordinates and create a polygon, rectangle, or ellipse. If the static_mode attribute is set to False the user can translate or rotate the shape. Signed-off-by: Brianna Major <[email protected]>
Once a user draws the bounding rectangle or ellipse for the region they'd like to mask they are able to translate and rotate the shape just like they can in the LLNL import tool. Right-click will complete the current patch and allow starting a new one. Signed-off-by: Brianna Major <[email protected]>
If the canvas is changed (by tab, tab mode or image mode) complete the current masks. Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
@psavery @saransh13 While I wrap this branch up I'd welcome any thoughts or opinions on the best way to interact with the rectangle/ellipse masking. Right now the user:
Do we need an additional or different option for indicating that the current mask is complete? Something that indicates that the template is in "interactive" (can be moved) mode still? I was thinking about the current mask being drawn in red and completed masks being drawn in black or something along those lines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking really nice so far! I have mostly minor suggestions for the code. I'll give it a try soon too.
70741d4
to
511b8f6
Compare
Instead, update the current canvas on image mode or tab mode change with signals. This behavior now matches the HandDrawnMaskDialog. Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Renamed: patch(es) -> interactive_template(s), raw_axes -> axis, kwargs -> polygon_kwargs Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
511b8f6
to
4ab41e0
Compare
@bnmajor Did you try rotating the masks in the polar view? The behavior appears a little odd. Ellipses in the raw view don't look as smooth as they used to. Do you know why? If I draw a mask and then right-click to save it, then click "Undo Last Selection", I get an exception. Also, can we make sure all of the signals get disconnected when the mask manager is hidden? It looks to me that if I use the mask manager several times in one session, the program slows down. Also, we should get feedback from @saransh13, but it might be more intuitive to change the clicking behavior to be like this:
However, I wonder if it will be difficult to allow the user to translate templates that were already saved (like allow them to translate any template they have already created). If that would be difficult, maybe we can skip that part. Overall, it is looking very nice, though! |
Signed-off-by: Brianna Major <[email protected]>
I did not test rotate in the polar view but there is indeed some strange behavior... Rotation causes some strange skewing. I will get that sorted out.
We're now drawing the ellipses with the more generic
I've added a commit with a lot more precautionary |
I think that this is all much smoother now! I've made a few updates and the behavior is now as follows:
|
db18f37
to
b16ebeb
Compare
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
Signed-off-by: Brianna Major <[email protected]>
3176da4
to
af3796a
Compare
This makes the ellipses in the polar view appear much smoother. Signed-off-by: Patrick Avery <[email protected]>
This aspect ratio takes into account both the extent and the canvas aspect ratio. Signed-off-by: Patrick Avery <[email protected]>
We only need to confirm that we are in the correct detector in the raw image mode. Signed-off-by: Brianna Major <[email protected]>
I accidentally inverted this... Signed-off-by: Patrick Avery <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is working well for me, thanks @bnmajor!
The one thing we might want to do in a future PR: if users are interacting with these masks on a high-resolution polar canvas, we probably want to animate the interactions so that they are much faster. But we will work on that only if someone requests it.
@saransh13, can you try this out and let us know if you have any suggested changes?
👍🏽 I’ll have feedback on this PR later today.
…On Wed, Sep 20, 2023 at 11:13 AM Patrick Avery ***@***.***> wrote:
***@***.**** approved this pull request.
This is working well for me, thanks @bnmajor <https://github.com/bnmajor>!
The one thing we might want to do in a future PR: if users are interacting
with these masks on a high-resolution polar canvas, we probably want to
animate the interactions so that they are much faster. But we will work on
that only if someone requests it.
@saransh13 <https://github.com/saransh13>, can you try this out and let
us know if you have any suggested changes?
—
Reply to this email directly, view it on GitHub
<#1569 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADYZ2U453C235RMITY3UIZ3X3MW4FANCNFSM6AAAAAA4NJMDQI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
After speaking with @saransh13 this branch needs the following:
|
Forgot to mention, the bug was with the arrow key. I did not test the same
behavior with the Mouse.
…On Wed, Sep 20, 2023 at 12:21 PM Brianna Major ***@***.***> wrote:
After speaking with @saransh13 <https://github.com/saransh13> this branch
needs the following:
- Larger step size for rotate by arrow key. This should only apply to
masking, not the LLNL import tool
- Bug fix: in polar view draw mask A -> move mask A -> draw mask B ->
move mask B -> mask A moves as well
—
Reply to this email directly, view it on GitHub
<#1569 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADYZ2U7UZZMTN7PAXAZLATLX3M63JANCNFSM6AAAAAA4NJMDQI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Signed-off-by: Brianna Major <[email protected]>
These are both fixed, although the angle of rotation was bumped an arbitrary amount. This value can be set to anything here. @saransh13 @psavery |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Feel free to merge when ready. We will animate the interactive template in a separate PR, and fix any more issues we encounter in future PRs.
Signed-off-by: Brianna Major <[email protected]>
0f010d3
to
85194d0
Compare
Signed-off-by: Brianna Major <[email protected]>
NEEDS:
KNOWN ISSUES:
Draw template(s) in raw -> switch to tabbed view -> draw template but do not save it -> switch to polar view -> cannot immediately draw on canvas