ó
 ‰\c           @   sq  d  d l  Z  d  d l Z d  d l m Z d  d l Z d d l m Z m Z d d l	 m
 Z
 d d l m Z d d l m Z m Z d d l m Z d  d l Z d  d	 l m Z e j Z e d
 „  e j e ƒ Dƒ ƒ Z e d e j ƒ  ƒ e   Z d „  Z d „  Z d „  Z d „  Z d „  Z d e f d „  ƒ  YZ  d e f d „  ƒ  YZ! e" d k rmd  d l# Z# e# j$ ƒ  n  d S(   iÿÿÿÿN(   t
   namedtuplei   (   t   iot   img_as_ubyte(   t   resize(   t
   color_dict(   t   file_or_url_contextt   is_url(   t   ImageCollection(   t   requestc         c   s1   |  ]' \ } } | t  d  „  | Dƒ ƒ f Vq d S(   c         s   s#   |  ] } t  d  | d ƒ Vq d S(   iÿ   g      à?N(   t   int(   t   .0t   c(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pys	   <genexpr>   s    N(   t   tuple(   R
   t   namet   rgb(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pys	   <genexpr>   s   t   colorsc         C   s
   t  |  ƒ S(   s0   Return Picture object from the given image path.(   t   Picture(   t   path(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   open   s    c         C   s³   t  |  t ƒ o t |  ƒ d k s9 t d j |  ƒ ƒ ‚ n  t d „  |  Dƒ ƒ rS |  St |  ƒ }  xG t |  ƒ D]9 \ } } t  | t ƒ rl t	 | | d ƒ |  | <} ql ql Wt |  ƒ S(   s5   Raise error if picture index is not a 2D index/slice.i   s   Expected 2D index but got {0!r}c         s   s   |  ] } t  | t ƒ Vq d  S(   N(   t
   isinstanceR	   (   R
   t   i(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pys	   <genexpr>!   s    i   (
   R   R   t   lent
   IndexErrort   formatt   allt   listt	   enumerateR	   t   slice(   t   indexR   t	   dim_slice(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   _verify_picture_index   s    !"c         C   s   t  j |  d ƒ S(   s.   Return RGB array with first 2 axes transposed.i   i    i   (   i   i    i   (   t   npt	   transpose(   t   array(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   rgb_transpose/   s    c         C   s   t  |  d d d … ƒ S(   s@   Return view of image transformed from array to Cartesian origin.Niÿÿÿÿ(   R"   (   t   image(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   array_to_xy_origin4   s    c         C   s#   t  |  d d … d d d … f ƒ S(   s@   Return view of image transformed from Cartesian to array origin.Niÿÿÿÿ(   R"   (   R#   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   xy_to_array_origin9   s    t   Pixelc           B   s"  e  Z d  Z d d „ Z e d „  ƒ Z e d „  ƒ Z e d „  ƒ Z e j d „  ƒ Z e d „  ƒ Z	 e	 j d „  ƒ Z	 e d	 „  ƒ Z
 e
 j d
 „  ƒ Z
 e d „  ƒ Z e j d „  ƒ Z e d „  ƒ Z e j d „  ƒ Z e d „  ƒ Z e j d „  ƒ Z d „  Z d „  Z d „  Z d „  Z RS(   sö  A single pixel in a Picture.

    Attributes
    ----------
    pic : Picture
        The Picture object that this pixel references.
    array : array_like
        Byte array with raw image data (RGB).
    x : int
        Horizontal coordinate of this pixel (left = 0).
    y : int
        Vertical coordinate of this pixel (bottom = 0).
    rgb : tuple
        RGB tuple with red, green, and blue components (0-255)
    alpha : int
        Transparency component (0-255), 255 (opaque) by default

    iÿ   c         C   ss   | |  _  | |  _ | |  _ |  j | d ƒ |  _ |  j | d ƒ |  _ |  j | d ƒ |  _ |  j | ƒ |  _ d  S(   Ni    i   i   (   t   _picturet   _xt   _yt	   _validatet   _redt   _greent   _bluet   _alpha(   t   selft   picR!   t   xt   yR   t   alpha(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   __init__R   s    			c         C   s   |  j  S(   s@   Horizontal location of this pixel in the parent image(left = 0).(   R(   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR1   [   s    c         C   s   |  j  S(   sA   Vertical location of this pixel in the parent image (bottom = 0).(   R)   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR2   `   s    c         C   s   |  j  S(   s'   The red component of the pixel (0-255).(   R+   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   rede   s    c         C   s    |  j  | ƒ |  _ |  j ƒ  d  S(   N(   R*   R+   t	   _setpixel(   R/   t   value(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR5   j   s    c         C   s   |  j  S(   s)   The green component of the pixel (0-255).(   R,   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   greeno   s    c         C   s    |  j  | ƒ |  _ |  j ƒ  d  S(   N(   R*   R,   R6   (   R/   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR8   t   s    c         C   s   |  j  S(   s(   The blue component of the pixel (0-255).(   R-   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   bluey   s    c         C   s    |  j  | ƒ |  _ |  j ƒ  d  S(   N(   R*   R-   R6   (   R/   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR9   ~   s    c         C   s   |  j  S(   s0   The transparency component of the pixel (0-255).(   R.   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR3   ƒ   s    c         C   s    |  j  | ƒ |  _ |  j ƒ  d  S(   N(   R*   R.   R6   (   R/   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR3   ˆ   s    c         C   s   |  j  |  j |  j f S(   s7   The RGB color components of the pixel (3 values 0-255).(   R5   R8   R9   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR      s    c            s]   t  | ƒ d k r | ˆ  _ n; ‡  f d †  | Dƒ \ ˆ  _ ˆ  _ ˆ  _ d ˆ  _ ˆ  j ƒ  d  S(   Ni   c         3   s   |  ] } ˆ  j  | ƒ Vq d  S(   N(   R*   (   R
   t   v(   R/   (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pys	   <genexpr>˜   s    iÿ   (   R   t   rgbaR+   R,   R-   R.   R6   (   R/   R7   (    (   R/   s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR   ’   s
    (	c         C   s   |  j  |  j |  j |  j f S(   sY   The RGB color and transparency components of the pixel
        (4 values 0-255).
        (   R5   R8   R9   R3   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR;   œ   s    c            s<   ‡  f d †  | Dƒ \ ˆ  _  ˆ  _ ˆ  _ ˆ  _ ˆ  j ƒ  d  S(   Nc         3   s   |  ] } ˆ  j  | ƒ Vq d  S(   N(   R*   (   R
   R:   (   R/   (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pys	   <genexpr>¦   s    (   R+   R,   R-   R.   R6   (   R/   R7   (    (   R/   s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR;   £   s    .c         C   sg   y4 t  | ƒ } | d k  s' | d k r3 t ƒ  ‚ n  Wn, t k
 rb d } t | j | ƒ ƒ ‚ n X| S(   s-   Verifies that the pixel value is in [0, 255].i    iÿ   s;   Expected an integer between 0 and 255, but got {0} instead!(   R	   t
   ValueErrorR   (   R/   R7   t   msg(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR*   ©   s    c         C   s0   |  j  |  j j |  j |  j f <|  j j ƒ  d  S(   N(   R;   R'   t   xy_arrayR(   R)   t   _array_modified(   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR6   µ   s    c         C   s#   t  | t ƒ r |  j | j k Sd  S(   N(   R   R&   R;   (   R/   t   other(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   __eq__º   s    c         C   s+   |  j  |  j |  j |  j f } d j | Œ  S(   Ns.   Pixel(red={0}, green={1}, blue={2}, alpha={3})(   R5   R8   R9   R3   R   (   R/   t   args(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   __repr__¾   s    (   t   __name__t
   __module__t   __doc__R4   t   propertyR1   R2   R5   t   setterR8   R9   R3   R   R;   R*   R6   RA   RC   (    (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR&   >   s(   	
			R   c           B   sZ  e  Z d  Z d- d- d- d „ Z e d d „ ƒ Z e d „  ƒ Z e j	 d „  ƒ Z e d „  ƒ Z
 e
 j	 d „  ƒ Z
 d „  Z d	 „  Z e d
 „  ƒ Z e d „  ƒ Z d „  Z e d „  ƒ Z e d „  ƒ Z e j	 d „  ƒ Z e d „  ƒ Z e j	 d „  ƒ Z e d „  ƒ Z e j	 d „  ƒ Z d „  Z d „  Z d „  Z d „  Z d „  Z e d „  ƒ Z e j	 d „  ƒ Z e d „  ƒ Z e j	 d „  ƒ Z e d „  ƒ Z e j	 d „  ƒ Z e d „  ƒ Z e j	 d  „  ƒ Z e d! „  ƒ Z e j	 d" „  ƒ Z e d# „  ƒ Z e j	 d$ „  ƒ Z d% „  Z d& „  Z  d' „  Z! d( „  Z" d) „  Z# d* „  Z$ d+ „  Z% d, „  Z& RS(.   sŠ  A 2-D picture made up of pixels.

    Attributes
    ----------
    path : str
        Path to an image file to load / URL of an image
    array : array
        Raw RGB or RGBA image data [0-255], with origin at top-left.
    xy_array : array
        Raw RGB or RGBA image data [0-255], with origin at bottom-left.

    Examples
    --------
    Load an image from a file:

    >>> from skimage import novice
    >>> from skimage import data
    >>> picture = novice.open(data.data_dir + '/chelsea.png')

    Load an image from a URL (the URL must start with ``http(s)://`` or
    ``ftp(s)://``):

    >>> picture = novice.open('https://scikit-image.org/_static/img/logo.png')  # doctest: +SKIP

    Create a blank 100 pixel wide, 200 pixel tall white image:

    >>> pic = Picture.from_size((100, 200), color=(255, 255, 255))

    Use numpy to make an RGB byte array (shape is height x width x 3):

    >>> import numpy as np
    >>> data = np.zeros(shape=(200, 100, 3), dtype=np.uint8)
    >>> data[:, :, 0] = 255  # Set red component to maximum
    >>> pic = Picture(array=data)

    Get the bottom-left pixel:

    >>> pic[0, 0]
    Pixel(red=255, green=0, blue=0, alpha=255)

    Get the top row of the picture:

    >>> pic[:, pic.height-1]
    Picture(100 x 1)

    Set the bottom-left pixel to black:

    >>> pic[0, 0] = (0, 0, 0)

    Set the top row to red:

    >>> pic[:, pic.height-1] = (255, 0, 0)

    c         C   sW  t  |  _ d  |  _ d  |  _ t g  | | | g D] } | d  k	 r. | ^ q. ƒ } | d k rn d } t | ƒ n¨ | d  k	 ræ t | ƒ s› t j	 j
 | ƒ } n  | |  _ t | ƒ 1 } t t j | ƒ ƒ |  _ t j | ƒ |  _ Wd  QXn0 | d  k	 rþ | |  _ n | d  k	 r| |  _ n  |  j j d d k rSt j |  j d d d d d ƒ|  _ n  d  S(	   Ni   s:   Must provide a single keyword arg (path, array, xy_array).iÿÿÿÿi   t   valuesiÿ   t   axisi   (   t   Falset	   _modifiedt   Nonet   _patht   _formatR   R<   R   t   osR   t   abspathR   R   R   t   imreadR!   t   imghdrt   whatR>   t   shapeR   t   insert(   R/   R   R!   R>   t   at   n_argsR=   t   context(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR4   û   s(    			4	t   blackc         C   s­   t  | t j ƒ r t | } n  t |  ƒ t | ƒ f } t j | d t j ƒ} t j	 | d t j ƒ| } | j
 d d k r  t j | d d d d d ƒ} n  t d | ƒ S(	   sJ  Return a Picture of the specified size and a uniform color.

        Parameters
        ----------
        size : tuple
            Width and height of the picture in pixels.
        color : tuple or str
            RGB or RGBA tuple with the fill color for the picture [0-255] or
            a valid key in `color_dict`.
        t   dtypeiÿÿÿÿi   RI   iÿ   RJ   i   R!   (   R   t   sixt   string_typesR   R   R   R   R!   t   uint8t   onesRU   RV   R   (   t   sizet   colort   rgb_sizeR!   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt	   from_size  s    !c         C   s   |  j  S(   s!   Image data stored as numpy array.(   t   _array(   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR!   ,  s    c         C   s=   | j  t j ƒ |  _ t |  j ƒ |  _ |  j j ƒ  |  _ d  S(   N(   t   astypeR   R^   Rd   R$   t	   _xy_arrayt   copyt   _array_backup(   R/   R!   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR!   1  s    c         C   s   |  j  S(   s@   Image data stored as numpy array with origin at the bottom-left.(   Rf   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR>   7  s    c         C   s   | |  _  t | ƒ |  _ d  S(   N(   Rf   R%   Rd   (   R/   R!   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR>   <  s    	c         C   s°   |  j  j d k ri |  j  j d d k ri t j j | ƒ d j ƒ  d k ri |  j  d d d … f |  _  n  t j | |  j  ƒ t	 |  _
 t j j | ƒ |  _ t j | ƒ |  _ d S(	   sª   Saves the picture to the given path.

        Parameters
        ----------
        path : str
            Path (with file extension) where the picture is saved.
        i   iÿÿÿÿi   s   .jpgs   .jpeg.N(   s   .jpgs   .jpeg(   R!   t   ndimRU   RP   R   t   splitextt   lowerR   t   imsaveRK   RL   RQ   RN   RS   RT   RO   (   R/   R   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   saveA  s    ("	c         C   s   |  j  |  _ d S(   sD   Reset image to its original state, removing modifications.

        N(   Rh   R!   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   resetQ  s    c         C   s   |  j  S(   s   The path to the picture.(   RN   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR   W  s    c         C   s   |  j  S(   s    True if the picture has changed.(   RL   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   modified\  s    c         C   s   t  |  _ d  |  _ d  S(   N(   t   TrueRL   RM   RN   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR?   a  s    	c         C   s   |  j  S(   s    The image format of the picture.(   RO   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR   e  s    c         C   s   |  j  j d  S(   s(   The size (width, height) of the picture.i   (   R>   RU   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR`   j  s    c         C   s–   | d |  j  k s& | d |  j k r’ t | d ƒ t | d ƒ f } t |  j | d d d t d d d t ƒ} | j t j	 ƒ |  _ |  j
 ƒ  n  d  S(   Ni    i   t   ordert   preserve_ranget   modet   constantt   anti_aliasing(   t   widtht   heightR	   R   R!   Rp   RK   Re   R   R^   R?   (   R/   R7   t   new_sizet	   new_array(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR`   o  s    & 	c         C   s   |  j  d S(   s   The width of the picture.i    (   R`   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyRv   |  s    c         C   s   | |  j  f |  _ d  S(   N(   Rw   R`   (   R/   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyRv     s    c         C   s   |  j  d S(   s   The height of the picture.i   (   R`   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyRw   …  s    c         C   s   |  j  | f |  _ d  S(   N(   Rv   R`   (   R/   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyRw   Š  s    c         C   s   t  j |  j ƒ t  j ƒ  d S(   s   Display the image.N(   R   t   imshowR!   t   show(   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR{   Ž  s    c            sN   |  j  |  j g ‰  t d d g d ‡  f d †  ƒ} t j ˆ  ƒ t j ƒ  d S(   s,   Compare the image to its unmodified version.i    i   t	   load_funcc            s   ˆ  |  S(   N(    (   R1   (   t   images(    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   <lambda>–  s    N(   Rh   R!   R   R   t   imshow_collectionR{   (   R/   t   ic(    (   R}   s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   compare“  s    !c         C   s,   |  j  | | f } t |  |  j | | | ƒ S(   s0   Create a Pixel object for a given x, y location.(   R>   R&   R!   (   R/   R1   R2   R   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt
   _makepixelš  s    c         C   s    |  j  d d … d d … | f S(   s<   Return a specific dimension out of the raw image data slice.N(   Rd   (   R/   t   channel(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   _get_channelŸ  s    c         C   s&   | |  j  d d … d d … | f <d S(   s5   Set a specific dimension in the raw image data slice.N(   Rd   (   R/   Rƒ   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   _set_channel£  s    c         C   s   |  j  d ƒ j ƒ  S(   s'   The red component of the pixel (0-255).i    (   R„   t   ravel(   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR5   §  s    c         C   s   |  j  d | ƒ d  S(   Ni    (   R…   (   R/   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR5   ¬  s    c         C   s   |  j  d ƒ j ƒ  S(   s)   The green component of the pixel (0-255).i   (   R„   R†   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR8   °  s    c         C   s   |  j  d | ƒ d  S(   Ni   (   R…   (   R/   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR8   µ  s    c         C   s   |  j  d ƒ j ƒ  S(   s(   The blue component of the pixel (0-255).i   (   R„   R†   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR9   ¹  s    c         C   s   |  j  d | ƒ d  S(   Ni   (   R…   (   R/   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR9   ¾  s    c         C   s   |  j  d ƒ j ƒ  S(   s0   The transparency component of the pixel (0-255).i   (   R„   R†   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR3   Â  s    c         C   s   |  j  d | ƒ d  S(   Ni   (   R…   (   R/   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR3   Ç  s    c         C   s&   |  j  d d … d d … d d … f S(   s7   The RGB color components of the pixel (3 values 0-255).Ni   (   R>   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR   Ë  s    c         C   s,   | |  j  d  d  … d  d  … d  d … f <d  S(   Ni   (   R>   (   R/   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR   Ð  s    c         C   s   |  j  S(   s8   The RGBA color components of the pixel (4 values 0-255).(   R>   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR;   Ô  s    c         C   s   | |  j  (d  S(   N(   R>   (   R/   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR;   Ù  s    c         c   sI   xB t  |  j ƒ D]1 } x( t  |  j ƒ D] } |  j | | ƒ Vq& Wq Wd S(   s&   Iterates over all pixels in the image.N(   t   rangeRv   Rw   R‚   (   R/   R1   R2   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   __iter__Ý  s    c         C   sG   t  | ƒ } t d „  | Dƒ ƒ r/ |  j | Œ  St d |  j | ƒ Sd S(   s6   Return `Picture`s for slices and `Pixel`s for indexes.c         s   s   |  ] } t  | t ƒ Vq d  S(   N(   R   R	   (   R
   R   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pys	   <genexpr>æ  s    R>   N(   R   R   R‚   R   R>   (   R/   t   xy_index(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   __getitem__ã  s    c         C   sg   t  | ƒ } t | t ƒ r+ | |  | _ n. t | t ƒ rM | j |  j | <n t d ƒ ‚ |  j ƒ  d  S(   Ns   Invalid value type(   R   R   R   R   R   R>   t	   TypeErrorR?   (   R/   R‰   R7   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   __setitem__ë  s    c         C   s4   t  | t ƒ s t ƒ  ‚ n  t j |  j | j k ƒ S(   N(   R   R   t   NotImplementedErrorR   R   R!   (   R/   R@   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyRA   õ  s    c         C   s   d j  |  j Œ  S(   Ns   Picture({0} x {1})(   R   R`   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyRC   ú  s    c         C   s   |  j  d ƒ S(   Nt   png(   t   _repr_image_format(   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt
   _repr_png_ý  s    c         C   s   |  j  d ƒ S(   Nt   jpeg(   R   (   R/   (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   _repr_jpeg_   s    c         C   s?   t  j ƒ  } t j | |  j d | ƒ| j ƒ  } | j ƒ  | S(   Nt
   format_str(   R\   t   BytesIOR   Rl   R!   t   getvaluet   close(   R/   R“   t
   str_buffert
   return_str(    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR     s
    
N('   RD   RE   RF   RM   R4   t   staticmethodRc   RG   R!   RH   R>   Rm   Rn   R   Ro   R?   R   R`   Rv   Rw   R{   R   R‚   R„   R…   R5   R8   R9   R3   R   R;   Rˆ   RŠ   RŒ   RA   RC   R   R’   R   (    (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyR   Ã   sZ   6											
				t   __main__(%   RP   RS   t   collectionsR    t   numpyR   t    R   R   t	   transformR   Ra   R   t   io.utilR   R   t   io.collectionR   R\   t   six.moves.urllibR   t   urlopent   dictt	   iteritemst   keysR   R   R   R"   R$   R%   t   objectR&   R   RD   t   doctestt   testmod(    (    (    s5   lib/python2.7/site-packages/skimage/novice/_novice.pyt   <module>   s2   							…ÿ I