<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.28.3">
</HEAD>
<BODY>
Do any of the image processing cells in your image notebook (which is great help btw!) implicitly leverage<BR>
ipython's parallel flows at all? <BR>
<BR>
On Wed, 2012-07-18 at 16:49 -0500, MinRK wrote:<BR>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    On Wed, Jul 18, 2012 at 4:12 PM, Thomas Kluyver &lt;<A HREF="mailto:takowl@gmail.com">takowl@gmail.com</A>&gt; wrote:<BR>
    <BLOCKQUOTE>
        Hi Darren,
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BR>
        On 18 July 2012 22:01, Darren Govoni &lt;<A HREF="mailto:darren@ontrenet.com">darren@ontrenet.com</A>&gt; wrote:<BR>
        &gt; 1) Is there a thorough tutorial on notebook? From hello world to the UI<BR>
        &gt; features?<BR>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        There's a folder of example notebooks, including an introduction one.<BR>
        They may have come with your installation, depending on where you got<BR>
        it from, or you can get them here:<BR>
        <A HREF="https://github.com/ipython/ipython/tree/master/docs/examples/notebooks">https://github.com/ipython/ipython/tree/master/docs/examples/notebooks</A>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BR>
        &gt; 2) I want to do some image processing with it. Is there an example (or is it possible) &gt; to interact with image data? e.g. run some ipython code, return/display the image result?<BR>
        <BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        It's certainly possible, although I don't know if there's an example<BR>
        yet. For simple cases, matplotlib has imread() and imshow() functions.<BR>
        Working with PIL might need a little integration, but hopefully just a<BR>
        few extra lines.
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    Here is a notebook I made while trying to follow along with one of Fernando's Py4Science tutorials, which covered working with image data:
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <A HREF="https://gist.github.com/3139142">https://gist.github.com/3139142</A>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    It includes the code for automatically displaying PIL objects as images in the notebook, which I added later:
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    from io import BytesIO
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    def display_image(img, format='PNG'):
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    &nbsp; &nbsp; fp = BytesIO()
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    &nbsp; &nbsp; img.save(fp, format=format)
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    &nbsp; &nbsp; return fp.getvalue()
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    ip = get_ipython()
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    png_formatter = ip.display_formatter.formatters['image/png']
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    png_formatter.for_type_by_name('Image', 'Image', display_image)
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    which we might want to have on by default.
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    -MinRK
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
    <BR>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    &nbsp;
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        <BR>
        Best wishes,<BR>
        Thomas
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BLOCKQUOTE>
        _______________________________________________<BR>
        IPython-User mailing list<BR>
        <A HREF="mailto:IPython-User@scipy.org">IPython-User@scipy.org</A><BR>
        <A HREF="http://mail.scipy.org/mailman/listinfo/ipython-user">http://mail.scipy.org/mailman/listinfo/ipython-user</A><BR>
        <BR>
    </BLOCKQUOTE>
</BLOCKQUOTE>
<BLOCKQUOTE TYPE=CITE>
    <BR>
<PRE>
_______________________________________________
IPython-User mailing list
<A HREF="mailto:IPython-User@scipy.org">IPython-User@scipy.org</A>
<A HREF="http://mail.scipy.org/mailman/listinfo/ipython-user">http://mail.scipy.org/mailman/listinfo/ipython-user</A>
</PRE>
</BLOCKQUOTE>
<BR>
</BODY>
</HTML>