-
Notifications
You must be signed in to change notification settings - Fork 43
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
70 Create a GUI entrypoint #75
Conversation
@constantinpape could you check this first version for the 2d annotator? |
f929142
to
5138bfe
Compare
Hi @paulhfu, Annotator does not start due to import errorFor me the 2d annotator does not start because of a vigra import error:
I think this can be avoided by refactoring the GUI as follows:
Warnings about stylefilesAlso, I get the following warnings when starting the GUI:
LinterFinally: my linter is not so happy when looking at your file ;). It would be great if you could get a PEP8 compatible linter set-up and run it on your files. For referene, I am using |
Hi @constantinpape, next time I will clean the code before comitting. I will investigate a bit more, maybe there is a simple solution. |
Thanks!
Ok. A possible solution would maybe be to do these GUIs in magicgui as well. (It can be used standalone and does not depend on napari).
I think that the dark theme is working. Anyways, the warnings are not so important for now; it's more important to get the GUI itself working first ;) . |
I tried also a magicgui version and there the examples from the website where just showing black windows without event loop. |
Can you point me to which example you mean exactly? |
I copied some code snippeds from here: If I make a new env with only magicgui and its upstream dependencies in it not even the black windows is showing and I see this warning: |
Thanks for clarifying, I will check it tomorrow morning. |
It's not working for me either, see pyapp-kit/magicgui#566 . |
Regarding the widget creation when using the decorator: yes... the decorator creates a widget. Use magic_factory if you don't immediately want a widget... see more here: https://pyapp-kit.github.io/magicgui/decorators/#magic_factory As for the examples, if you're running in a script, add .show(run=True). Will update docs |
Thanks for the clarification here as well @tlambert03 ! |
Thanks a lot @tlambert03. It is working now. Maybe I could add some more refinements. I could not center-align the header. |
Thanks @paulhfu! This looks ok for now. Let's go ahead with it and see if the whole mechanism works now. |
Hi @constantinpape, What version of flake8 are you using and do you have a config file for it? I am getting a lot of errors in all files. Mostly "line too long" but also others. I am using v2023.6.0 with the default configs. |
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 gave this a very quick view, and the structure looks good. I will have a closer look once you say it's ready for review.
micro_sam/sam_annotator/annotator.py
Outdated
sub_widget.show() | ||
|
||
|
||
def main(): |
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.
Let's call this annotator
to be consistent with the other files.
I am using the default settings, except for
Let me know if there's any more significant warnings for you after setting the line length to 120, then I can have another look at this! |
@constantinpape thank you for the config. Looks much better now.
|
@paulhfu all of these should be fixed if you merge the current |
40c68a8
to
46a73d0
Compare
@constantinpape yes, thank you, I rebased. |
You're right, that's still missing. Please go ahead and add the import here. |
46a73d0
to
7ed9638
Compare
@constantinpape, this can now be reviewed. I could not finish all my tests, I will continue later. Open questions from my side are:
Open Issues:
|
Thanks @paulhfu ! Looks very good overall. Before I go through your questions: one more thing I noticed that is missing in the
I don't see that particular warning anymore. Let's keep the stylesheet for now, we can look closer into this later if it comes up again.
I am not quite sure what you mean. Can you give an example?
Yes, that's ok. You could also use https://github.com/computational-cell-analytics/micro-sam/blob/master/micro_sam/util.py#L480 . It does the same thing you describe, but you wouldn't need to duplicate that code, and maybe I have time to do something smarter / extend support for more file formats there at some point.
No, tiling is always done just in 2d. So it should be just
I also saw that warning pop up once. But for now I would suggest that we do not tackle this in the current PR but rather leave it for follow up work. I want to publish a new release next week, and once you have addressed the two main remaining issues (input_key and tiling / halo) I would merge it so that it can be included in the release; since this is already the most user-friendly way of starting |
4dc3633
to
272ef06
Compare
Hi @constantinpape,
I got errors which stated something along the lines "Grayscale is not supported for 3D annotation. User RGB" I applied your suggestions. |
Yeah, I think I fixed that on master. |
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 will go ahead and merge this now. The base functionality is working, and we can improve it in potential follow-ups. Thanks!
@@ -13,6 +13,7 @@ | |||
license="MIT", | |||
entry_points={ | |||
"console_scripts": [ | |||
"micro_sam.annotator = micro_sam.sam_annotator.annotator:main", |
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.
@constantinpape, will this entry not be part in the conda-forge review?
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.
It will be part of conda-forge, but I will need to publish a new release of micro_sam
first. Will try to do that tomorrow morning.
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.
Thanks. Got it.
Fixes 70
So far only 2d annotator is implemented.