-
Notifications
You must be signed in to change notification settings - Fork 88
Ensure valid layers exist for each annotator click menu #943
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
Conversation
|
Aaaaaaaand this works all as expected now! ;) GTG from my side! Let me know how it looks! @constantinpape |
|
The tracking annotator needs some specific changes for the layers, as it is hard-coded at the moment in the annotator tracking (which also makes sense as it needs specific label layers). I will look into fixing this tomorrow! (PS. I can reproduce the issue on my laptop which is easy to debug) EDIT: @constantinpape, I hand it over to you now! |
|
Ah I see, this is for fixing #942 and not for the current dev. I didn't understand that when we discussed this during breakfast. Let's wait till after the last TiM workshop to fix this. I would avoid making live changes, unless they fix genuine bugs. |
|
The test error occurs because |
|
We rename |
|
We should also call a |
|
Okay, took me a bit longer to sort things out in an elegant way, but we have it all now (hopefully)! Let me know how it looks @constantinpape! PS. I tested both the aforementioned suggestions on annotator 2d. |
constantinpape
left a comment
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.
The design looks good overall, only some detailed comments.
constantinpape
left a comment
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.
I think the core logic is there now, only a few minor things to address.
Besides the things I mentioned in the comments: you also need to set reset_state=False here: https://github.com/computational-cell-analytics/micro-sam/blob/master/micro_sam/sam_annotator/image_series_annotator.py#L100-L107
|
I would say everything works as expected now. Let me know how it looks @constantinpape Also, once you have time, it would be nice to have another pair of eyes testing the annotators! |
|
I checked the changes and they look good. However, one thing is not working in the tracking annotator: simplescreenrecorder-2025-03-26_08.45.36.mp4(the point should change the color, and also the division is not taken into account when running segmentation) |
|
I have a suspicion why this might be not working. I will check back on this later in the evening! |
|
Hmm strange that I cannot reproduce the issue you encountered. I will check back once again after lunch and post you with a video (with the latest state of Edit 1: Okay I spoke too soon, sorry. I can reproduce the exact same steps you showed. Edit 2: The video behavior only happens when the |
Yes, indeed it only happens when the point prompts are removed. I am pretty sure the problem is because the tracking menu (created here) only works for the specific point prompt layer, and the connected events are not working anymore once the layer is removed and added again. It should be possible to fix this by reconnecting the events:
It's probably easiest to update the |
|
Okay wow your suggestion worked (thank you so very much @constantinpape <3) |
|
I still get an error when switching to division after the point prompts have been removed: (only a short snippet of the full error message) |
|
I checked this out again, and it only happens when removing the point layer multiple times. I don't quite now how to get to the root cause, but I think this is an acceptable limitation since: I will go ahead and merge it once the tests pass. |
|
Thanks for confirming this @constantinpape!
This is super useful to know. I will open an issue on this so that we are aware of this behaviour on current |
This PR ensures if all layers exist or not. If not, it creates dummy layers and avoids throwing ambiguous errors. I checked it for 2d annotator only, but should work for all annotators, as they share the same components!
PS. One thing that is still tricky is the
commitoption. It can't account for missing layers. I am thinking if I can raise a error window stating that the layers do not exist, hence commit won't work, and once the user closes the window, create dummy layers. (I'll check this out now)WIP!