Advice on basic operations: zoom, crop and splice

Stéfan van der Walt stefan at sun.ac.za
Sat Nov 23 05:04:19 EST 2013


On Sat, Nov 23, 2013 at 8:16 AM, Chintak Sheth <chintaksheth at gmail.com> wrote:
> An interesting thread regarding interactive image
> manipulation in iPython notebook came up lately which might interest you:
> https://groups.google.com/forum/#!topic/scikit-image/vrPzanJ42rs.

I spoke to Brian Granger about the possibility of building the viewer
described above in IPython.  Here is his response:

"""
Definitely possible - shouldn't be too bad.  Here is a rough sketch:

* You can define a Python object with traitlets.
* You get a JavaScript object that has the same exact attributes as
the Python object - we keep those attributes completely synchronized
on the two sides automatically. When the JavaScript side (through UI
control changes) changes the attributes we sync the python side and
all of the traitlets callbacks will fire. When the Python side makes
changes, the JS side is updated and the UI will refresh. The time
scale for all of this is super fast - at least running on localhost.
* You can then create arbitrary "view" code for the JavaScript side.
You get a div to put the UI in and can do whatever you want.
* The JavaScript and Python objects also have methods for sending
arbitrary JSON messages at any time, so you can stream data, etc.

To get familiar with how it all works, have a look at the notebooks in
this branch:

https://github.com/jdfreder/ipython/tree/widget-msg/examples/widgets

They show how to develop new widgets from scratch as well as how all
of the existing ones can be used.
"""

I am really keen to try this out next week, although I may have to up
my Javascript-foo a bit.

Stéfan



More information about the scikit-image mailing list