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

Output data #11

Open
PatricioUQ opened this issue Mar 15, 2022 · 6 comments
Open

Output data #11

PatricioUQ opened this issue Mar 15, 2022 · 6 comments

Comments

@PatricioUQ
Copy link

Hi,

I am trying to use this in a notebook running on VS code. It seems to be working, however, not sure how to get out (or to see) what I have segmented. I am relatively new at python.

Cheers,

PPM

@ianhi
Copy link
Owner

ianhi commented Mar 15, 2022

Hi @PatricioUQ

It's not really clear from the example: https://github.com/ianhi/ipysegment/blob/master/examples/introduction.ipynb

but you need to first call w.gimme() to sync the data back to python. Unfortunately due to limitations in ipython (hopefully fixed in the nearish future) there is no way to block until the data is synced back. After that you can access the data as w.data

that said - now that I look back at this I think it was irresponsible to publish this as is. I need to either remove it from pypi or else put some effort in updating it to be more functional. As it stands it's not really fully functional and completely undocumented. I haven't pushed on developing it much because now I always use the napari labels layer to annotate image masks. It is by far the best python based mask drawer that I have found. On top of that I generally add a set of keybindings that I think make it excellent for drawing masks. You can see those here: https://github.com/Hekstra-Lab/napari-labeller/blob/main/src/napari_labeller/_keybinds.py

@ianhi
Copy link
Owner

ianhi commented Mar 15, 2022

What's your use case?

I need to either remove it from pypi or else put some effort in updating it to be more functional

Updating this is definitely something I want to do - it's just unfortuntaely one of those things that has always been on the backburner. I'd also happily accept PRs.

I think I currently want to move to inherit from ipycanvas, then we could make use of this: https://ipycanvas.readthedocs.io/en/latest/retrieve_images.html#get-image-data-as-a-numpy-array

and even loftier goals are to make much better drawing based on http://fabricjs.com/ which would make it much easier to focus on integrating in jupyter, rather than re-implementing a drawing app from scratch

@PatricioUQ
Copy link
Author

Hi ianhi,

Thank you for your fast reply.

To be honest, your tool is exactly what I need: the simplest possible tool to manually segment/crop images (np arrays). I think I will give it a go and see if I can make it work in my project as it is (without you needing to update anything). If this doesn't work, I will try napari as suggested.

Cheers,

@ianhi
Copy link
Owner

ianhi commented Mar 15, 2022

ack! I completely forgot to mention my other tool that also accomplishes this simple task. It is: https://mpl-interactions.readthedocs.io/en/stable/examples/image-segmentation.html

Pros:

  1. it's matplotlib based so it will also work outside of notebooks (works in notebooks with ipympl)
  2. data lives in python first so no syncing issues
  3. You can throw arbitrary matplotlib stuff onto the plot to guide you if you want

Cons:

  1. Worse performance than this (that bad performance actually inspired creating this)

@ianhi
Copy link
Owner

ianhi commented Mar 15, 2022

I think I will give it a go and see if I can make it work in my project as it is (without you needing to update anything).

@PatricioUQ have at it! Though to be clear I'm happy to update things, just hasn't been a priority. If you run into any issues or ways you could see to improve it please feel free to open issues, if I don't know about an issue then I can't fix it ;)

@PatricioUQ
Copy link
Author

Thanks, I will keep you posted

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

No branches or pull requests

2 participants