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

BIG WIP: feat: ROI model/view #54

Draft
wants to merge 2 commits into
base: v2-mvc
Choose a base branch
from
Draft

Conversation

gselzer
Copy link
Collaborator

@gselzer gselzer commented Nov 15, 2024

This PR provides a ROIModel class to maintain state about regions of interest, as well as a PRoiView protocol for views to implement when they want to react to changes in a ROIModel. This PR is by no means ready for merge, but exists for visibility and discussion about what is needed here.

For now, I'll edit mvc.py to include a (rectangular) ROI - next steps are to make it movable/resizable

Running points of discussion:

  • What attributes are needed for the ROIModel? For a ND rectangular ROI, all we really need is minimum and maximum points in N dimensions, but thinking more broadly about lines, ellipses, freehand ROI selections, we might want more here. One idea I kind of like is an attribute that can provide a field of positions - something like imglib2's IterableRegion.
  • Should ROIModel itself be a protocol that e.g. RectangularROIModel, LineROIModel, etc. implement?

@gselzer
Copy link
Collaborator Author

gselzer commented Nov 15, 2024

@tlambert03 one fun bug that just popped up for me is some strange rendering behavior if you run mvc.py, but then use the roi button to create a new ROI - parts of the rectangle border do not render (and the specific ones that do changed based on the window zoom), and the handles are occluded by the rectangle...kinda?

I'd be interested to see if you can reproduce 😅

python_oE1INx9Fq4

@tlambert03
Copy link
Member

I'd be interested to see if you can reproduce 😅

nope... wasn't able to see that

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

Successfully merging this pull request may close these issues.

2 participants