o
    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   ]/var/www/html/scripts/venv/lib/python3.10/site-packages/skimage/measure/tests/test_profile.pytest_horizontal_rightward	   s   r   c                  C   .   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      r   c                  C   r   )	Nr      r   r!   r   r   r      _   r   r   r   r   r   r   test_vertical_downward   r   r%   c                  C   r   )	Nr"   r    r   r   r   U      ir   r   r   r   r   test_vertical_upward   r   r(   c                  C   .   t tddddd} tg d}t| | d S )Nr   r   r   r   r   r   r   )
   !   r-   ,   7   r/   B   M   r1   X   )r   r   r   arrayr   r   r   r   r   test_45deg_right_downward!   s   r4   c                  C   r   )	Nr*   r+   r   r   r   r,   r2   r   r   r   r   linspacer   r   r   r   r   &test_45deg_right_downward_interpolated,   r   r7   c                  C   r   )	Nr   r   r   r   r   r   r   R      ir   r   r   r   r   r   r   r   r   test_45deg_right_upward2   r   r=   c                  C   r   )	Nr+   r*   r   r   r   r2      gUUUUUUr<   r   r   r   r   test_45deg_left_upward8   r   r?   c                  C   r   )	Nr9   r8   r   r   r      S      r<   r   r   r   r   test_45deg_left_downward>   r   rC   c                  C   r)   )Nr   r      r   r   r   r   )   r,      r-   "   -   8   9   C   D   O   )r   r   r   r3   r   r   r   r   r   (test_pythagorean_triangle_right_downwardD   r   rP   c                  C   s.   t tddddd} tddd}t| | d S )NrD   rE   r   r   r   rG   rO   r5   r   r   r   r   5test_pythagorean_triangle_right_downward_interpolatedJ   r   rQ   )rB   rF   ))r   r   r   r   r      )r   r   r   r   rR   r!   ))r   r   r   rR   rR   r!   )r   r   r   r   rR   rR   ))r   r   r   r   r   r   )r   r   r   rR   r!   rB   g?g333333?c                  C   s,   t tdddddd} td}t| | d S )NrD   )rR   r!   r   r   r   	linewidthr   r   rB   r   
pyth_imager   onesr   r   r   r   r   2test_pythagorean_triangle_right_downward_linewidthY   s
   
rX   c                  C   s>   t td d dd d f dddddd} td}t| | d S )	Nr   )rR   r   )r   r!   r   r   r   rS   rB   rU   r   r   r   r   0test_pythagorean_triangle_right_upward_linewidth`   s
   
rY   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   rR   )r!   r   r   r   r   rS   rB   )r   rV   Tr   rW   r   r   r   r   r   7test_pythagorean_triangle_transpose_left_down_linewidthg   s
   
r[   c               	   C   @   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rT   r   reduce_funcr   rR   r   r   rV   r   meanr   r   r   r   r   test_reduce_func_meann   
   re   c               	   C   r\   r]   )r   rV   r   maxr   r   r   r   r   test_reduce_func_maxu   rf   rh   c               	   C   r\   r]   )r   rV   r   sumr   r   r   r   r   test_reduce_func_sum|   rf   rj   c               	   C   s6   t tddddtjdd} td ddf }t| | d S )Nr^   r_   r   r   r   ra   rR   rc   r   r   r   r   !test_reduce_func_mean_linewidth_1   s
   rk   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   rR   r   r   r   r   ra   r!   r   )r   rV   r   newaxisr   r   r   r   r   !test_reduce_func_None_linewidth_1   
   
ro   c               	   C   s8   t tddddd dd} tdddd	f }t| | d S )
Nrl   rm   r   r   r   ra   r   r!   rR   )r   rV   r   r   r   r   r   !test_reduce_func_None_linewidth_3   rp   rq   c               	   C   L   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   rb      s   z8test_reduce_func_lambda_linewidth_3.<locals>.reduce_funcrl   rm   r   r   r   ra   r   r!   rR   arraxisr   rV   r   apply_along_axisr   rb   r   r   r   r   r   #test_reduce_func_lambda_linewidth_3      r{   c               	   C   rr   )Nc                 S   s   | d S Ng      ?r   rs   r   r   r   rb      s   z6test_reduce_func_sqrt_linewidth_3.<locals>.reduce_funcrl   rm   r   r   r   ra   r   r!   rR   ru   rx   rz   r   r   r   !test_reduce_func_sqrt_linewidth_3   s   
r~   c               	   C   rr   )Nc                 S   s   t | d S r}   )r   ri   rs   r   r   r   rb      s   z;test_reduce_func_sumofsqrt_linewidth_3.<locals>.reduce_funcrl   rm   r   r   r   ra   r   r!   rR   ru   rx   rz   r   r   r   &test_reduce_func_sumofsqrt_linewidth_3   r|   r   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   ra   )rV   shaper   r   vstackzerosrn   r   )offsetidxr   r   r   r   r   test_oob_coodinates   s   r   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saJ t|||d
d}t	|d | dksuJ t	||ks}J d S )N)   r   )         r   r   r   rR   g      "@   r`   )r   )
r   meshgridrangepicossinr   astypeuint8all)r   center_xcenter_yradiusrt   ymasksrcphidydxdst
profile_u8	profile_br   r   r   test_bool_array_input   s     r   )*numpyr   _shared.testingr   r   profiler   r   reshaper   floatr   r   r   r%   r(   r4   r7   r=   r?   rC   rP   rQ   r   rV   linebelowaboverX   rY   r[   re   rh   rj   rk   ro   rq   r{   r~   r   r   r   r   r   r   r   <module>   sH    

