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

Do not hardcode mask shape in on_select #3

Open
ianhi opened this issue Jan 10, 2021 · 3 comments
Open

Do not hardcode mask shape in on_select #3

ianhi opened this issue Jan 10, 2021 · 3 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ianhi
Copy link
Owner

ianhi commented Jan 10, 2021

Currently the image shape is hardcoded in on_select

def onselect(self,verts):
self.verts = verts
p = Path(verts)
self.indices = p.contains_points(self.pix, radius=0).reshape(450,540)
self.updateArray()
self.fig.canvas.draw_idle()

this is bad because it will always fail with differently shaped images. This should be fixed to use the shape of the current image.

@ianhi ianhi added enhancement New feature or request good first issue Good for newcomers labels Jan 10, 2021
@ianhi
Copy link
Owner Author

ianhi commented Jan 10, 2021

If anyone sees this and would like to make a PR changing it they are more than welcome to :)

@ianhi
Copy link
Owner Author

ianhi commented Jan 10, 2021

oooh, and even better than fixing that small part of image_segmenter. The project should be reconfigured to make use of the image_segmenter from mpl-interactions which is an improved version of the core lassoing utility. https://mpl-interactions.readthedocs.io/en/stable/examples/image-segmentation.html

Either the current image_segmenter can become a subclass of the class from mpl-interactions or we can make it a new class that just uses the mpl-interactions version for the lassoing part and implements the buttons and such around that.

@ianhi
Copy link
Owner Author

ianhi commented Jan 10, 2021

If #4 is fully implemented it will supercede this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant