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

Linked image viewers and docked plugins #575

Merged
merged 24 commits into from
Jun 28, 2013

Conversation

tonysyu
Copy link
Member

@tonysyu tonysyu commented May 31, 2013

This PR adds the ability link image viewers by passing in a Plugin (instead of an image array) to an image viewer. The Plugin's output image gets rendered in the viewer, and updates to that plugin trigger updates to the viewer. Linking allows you to create a processing pipeline to interactively view multi-step processing operations.

As part of this update, plugins can now be docked to the image viewer. Docking greatly simplifies window layout (so that linked viewer aren't initially displayed on top of one another) and in general, looks a bit cleaner, even for single-viewer examples.

@stefanv
Copy link
Member

stefanv commented May 31, 2013

Heh, almost there!

@tonysyu
Copy link
Member Author

tonysyu commented May 31, 2013

Finally!

tonysyu added 5 commits June 5, 2013 11:22
* Signal updates to original image when image changed in CollectionViewer.
* Update plugin arguments for the filter.
* Also fixes image updates when opening a new image from the file menu.
New QApplication and event-loop implementation stolen shamelessly from
IPython. Strangely, running the viewer at the IPython prompt will
open an orphan Matplotlib figure window, but running a script using
`%run` does not.

Only tested on PySide (not PyQt4).
@tonysyu
Copy link
Member Author

tonysyu commented Jun 26, 2013

Argh! My fix for PySide broke PyQt4. Debugging...

tonysyu added 2 commits June 25, 2013 23:15
I guess PySide saves the QApplication internally, while PyQt4 doesn't.
Saving the QApplication as a global prevents it from getting garbage
collected. Saving the QApplication as an instance variable in the
ImageViewer also works, but that might prevent the ImageViewer from getting
garbage collected in an interactive session. (weakref doesn't seem to work here.)
@tonysyu
Copy link
Member Author

tonysyu commented Jun 26, 2013

Fixed issue on PyQt4. I haven't tested the fix on PySide yet...

tonysyu added 3 commits June 25, 2013 23:24
Currently only works for main window, does not work for linked viewers.
Image filtering is usually slow, so updating on move was usually a bad idea.
JDWarner added a commit that referenced this pull request Jun 28, 2013
Linked image viewers and docked plugins
@JDWarner JDWarner merged commit 173fec0 into scikit-image:master Jun 28, 2013
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.

3 participants