U
    ?h                     @   s6  d dl ZddlmZmZ ddlmZ edd	e
Zdd	 Zd
d Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zdd Zede
ZdZd Zd!Zd"ee< d#ee< d#ee< d$d% Zd&d' Zd(d) Zd*d+ Zd,d- Z d.d/ Z!d0d1 Z"d2d3 Z#d4d5 Z$d6d7 Z%d8d9 Z&d:d; Z'd<d= Z(d>d? Z)dS )@    N   )assert_equalassert_almost_equal   )profile_lined   )
   r   c                  C   s,   t tddddd} tdd}t| | d S )Nr   r   r      r   constantordermoder   	   r   imagenparanger   profexpected_prof r   T/var/www/html/venv/lib/python3.8/site-packages/skimage/measure/tests/test_profile.pytest_horizontal_rightward	   s    r   c                  C   s.   t tddddd} tddd}t| | d S )	Nr
   r	   r   r   r   r      r   r   r   r   r   test_horizontal_leftward   s    r   c                  C   s.   t tddddd} tddd}t| | d S )	Nr      r   r   r   r   r      _   r   r   r   r   r   r   test_vertical_downward   s    r#   c                  C   s.   t tddddd} tddd}t| | d S )	Nr    r   r   r   r   U      ir   r   r   r   r   test_vertical_upward   s    r&   c                  C   s>   t tddddd} tddddd	d	d
dddg
}t| | d S )Nr   r   r   r   r   r   r      !   ,   7   B   M   X   )r   r   r   arrayr   r   r   r   r   test_45deg_right_downward!   s    r1   c                  C   s.   t tddddd} tddd}t| | d S )	Nr'   r(   r   r   r   r)   r/   r   r   r   r   Zlinspacer   r   r   r   r   &test_45deg_right_downward_interpolated,   s    r3   c                  C   s.   t tddddd} tddd}t| | d S )	Nr   r   r   r   r   r   r   R      ir   r   r   r   r   r   r   r   r   test_45deg_right_upward2   s    r9   c                  C   s.   t tddddd} tddd}t| | d S )	Nr(   r'   r   r   r   r/      gUUUUUUr8   r   r   r   r   test_45deg_left_upward8   s    r;   c                  C   s.   t tddddd} tddd}t| | d S )	Nr5   r4   r   r   r      S      r8   r   r   r   r   test_45deg_left_downward>   s    r?   c                  C   s@   t tddddd} tdddd	d
ddddddg}t| | d S )Nr   r      r   r   r   r      r)      r*   "   -   8   9   C   D   O   )r   r   r   r0   r   r   r   r   r   (test_pythagorean_triangle_right_downwardD   s     rL   c                  C   s.   t tddddd} tddd}t| | d S )Nr@   rA   r   r   r   rC   rK   r2   r   r   r   r   5test_pythagorean_triangle_right_downward_interpolatedJ   s    rM   )r>   rB   ))r   r   r   r   r      )r   r   r   r   rN   r   ))r   r   r   rN   rN   r   )r   r   r   r   rN   rN   ))r   r   r   r   r   r   )r   r   r   rN   r   r>   g?g333333?c                  C   s,   t tdddddd} td}t| | d S )Nr@   )rN   r   r   r   r   	linewidthr   r   r>   r   
pyth_imager   onesr   r   r   r   r   2test_pythagorean_triangle_right_downward_linewidthY   s
    
rT   c                  C   s>   t td d dd d f dddddd} td}t| | d S )	Nr   )rN   r   )r   r   r   r   r   rO   r>   rQ   r   r   r   r   0test_pythagorean_triangle_right_upward_linewidth`   s      
rU   c                  C   s@   t tjd d d d df dddddd} td}t| | d S )	Nr   )r   rN   )r   r   r   r   r   rO   r>   )r   rR   Tr   rS   r   r   r   r   r   7test_pythagorean_triangle_transpose_left_down_linewidthg   s      
rW   c               	   C   s@   t tddddtjdd} td dd df d}t| | d S 	Nr   r   r   r   r   r   reflectrP   r   reduce_funcr   rN   r   r   rR   r   Zmeanr   r   r   r   r   test_reduce_func_meann   s     r_   c               	   C   s@   t tddddtjdd} td dd df d}t| | d S rX   )r   rR   r   maxr   r   r   r   r   test_reduce_func_maxu   s     ra   c               	   C   s@   t tddddtjdd} td dd df d}t| | d S rX   )r   rR   r   sumr   r   r   r   r   test_reduce_func_sum|   s     rc   c               	   C   s6   t tddddtjdd} td ddf }t| | d S )NrY   rZ   r   r   r   r\   rN   r^   r   r   r   r   !test_reduce_func_mean_linewidth_1   s     rd   c               	   C   s8   t tddddd dd} tdddtjf }t| | d S )	Nr   r   rN   r   r   r   r   r\   r   r   )r   rR   r   newaxisr   r   r   r   r   !test_reduce_func_None_linewidth_1   s    
  rh   c               	   C   s8   t tddddd dd} tdddd	f }t| | d S )
Nre   rf   r   r   r   r\   r   r   rN   )r   rR   r   r   r   r   r   !test_reduce_func_None_linewidth_3   s    
  ri   c               	   C   sL   dd } t tdddd| dd}tj| td	d
d	df d	d}t|| d S )Nc                 S   s   | | d  S )Nr   r   xr   r   r   r]      s    z8test_reduce_func_lambda_linewidth_3.<locals>.reduce_funcre   rf   r   r   r   r\   r   r   rN   ZarrZaxisr   rR   r   Zapply_along_axisr   r]   r   r   r   r   r   #test_reduce_func_lambda_linewidth_3   s      ro   c               	   C   sL   dd } t tdddd| dd}tj| td	d
d	df d	d}t|| d S )Nc                 S   s   | d S Ng      ?r   rj   r   r   r   r]      s    z6test_reduce_func_sqrt_linewidth_3.<locals>.reduce_funcre   rf   r   r   r   r\   r   r   rN   rl   rm   rn   r   r   r   !test_reduce_func_sqrt_linewidth_3   s    
  rq   c               	   C   sL   dd } t tdddd| dd}tj| td	d
d	df d	d}t|| d S )Nc                 S   s   t | d S rp   )r   rb   rj   r   r   r   r]      s    z;test_reduce_func_sumofsqrt_linewidth_3.<locals>.reduce_funcre   rf   r   r   r   r\   r   r   rN   rl   rm   rn   r   r   r   &test_reduce_func_sumofsqrt_linewidth_3   s      rr   c               	   C   sx   d} t jd |  }tt |  df|dfddd dd}tt| dft d d dtjf t| d dfg}t|| d S )Nr   r   r   r   r\   )rR   shaper   r   Zvstackzerosrg   r   )offsetidxr   r   r   r   r   test_oob_coodinates   s      rw   c                  C   s   d} d\}}d}t t| d t| d \}}|| d || d  |d k }||f}dt j d }d	t | }	d	t | }
||	 ||
 f}t|t j||d
d}t	|d | dkst
t|||d
d}t	|d | dkst
t	||kst
d S )N)   rx   )         r   r   r   rN   g      "@   r[   )r   )r   Zmeshgridrangepicossinr   astypeZuint8allAssertionError)rs   Zcenter_xZcenter_yZradiusrk   ymasksrcphiZdyZdxdstZ
profile_u8Z	profile_br   r   r   test_bool_array_input   s      r   )*numpyr   Z_shared.testingr   r   Zprofiler   r   Zreshaper   floatr   r   r   r#   r&   r1   r3   r9   r;   r?   rL   rM   rt   rR   lineZbelowZaboverT   rU   rW   r_   ra   rc   rd   rh   ri   ro   rq   rr   rw   r   r   r   r   r   <module>   sF   

