o
    h                     @   s<  d dl Zd dlmZ d dlmZ d dlmZ d dlm	Z	m
Z
mZ d dlZd dl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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/d0 Z#d1d2 Z$d3d4 Z%d5d6 Z&d7d8 Z'ej()d9d:gd;d< Z*dS )=    N)_image_fetcher)io)assert_equalassert_almost_equalfetchc                  C   sz   t j} td ur!t   dt| v sJ tt| dksJ d S tt	 t   W d    d S 1 s6w   Y  d S )Nzastronaut.png2   )
datadata_dirr   download_alloslistdirlenpytestraisesModuleNotFoundError)r	    r   W/var/www/html/scripts/venv/lib/python3.10/site-packages/skimage/data/tests/test_data.pytest_download_all_with_pooch
   s   
"r   c                  C      t  } t| jd dS )z, Test that "astronaut" image can be loaded. )   r      N)r   	astronautr   shape)r   r   r   r   test_astronaut!      r   c                  C   r   )z) Test that "camera" image can be loaded.    N)r   camerar   ndim)	cameramanr   r   r   test_camera'   r   r   c                   C      t   dS )z/ Test that "checkerboard" image can be loaded. N)r   checkerboardr   r   r   r   test_checkerboard-      r"   c                   C   r    )z* Test that "chelsea" image can be loaded. N)r   chelsear   r   r   r   test_chelsea2   r#   r%   c                   C   r    )z( Test that "clock" image can be loaded. N)r   clockr   r   r   r   
test_clock7   r#   r'   c                   C   r    )z) Test that "coffee" image can be loaded. N)r   coffeer   r   r   r   test_coffee<   r#   r)   c                  C   s2   t d t } t| jd t| jtd dS )z( Test that "eagle" image can be loaded. zdata/eagle.pngr   uint8N)r   r   eagler   r   dtypenp)r+   r   r   r   
test_eagleA   s   r.   c                  C   s*   t  } t| jd t| jtd dS )z( Test that "horse" image can be loaded. r   boolN)r   horser   r   r,   r-   )r0   r   r   r   
test_horseK   s   r1   c                   C   r    )z) Test that "Hubble" image can be loaded. N)r   hubble_deep_fieldr   r   r   r   test_hubbleR   r#   r3   c                   C   r    )z7 Test that "immunohistochemistry" image can be loaded. N)r   immunohistochemistryr   r   r   r   test_immunohistochemistryW   r#   r5   c                  C   s(   t  } t| jd t| jd d dS )z' Test that "logo" image can be loaded. r   r      N)r   logor   r   r   )r7   r   r   r   	test_logo\   s   r8   c                   C   r    )z' Test that "moon" image can be loaded. N)r   moonr   r   r   r   	test_moonc   r#   r:   c                   C   r    )z' Test that "page" image can be loaded. N)r   pager   r   r   r   	test_pageh   r#   r<   c                   C   r    )z) Test that "rocket" image can be loaded. N)r   rocketr   r   r   r   test_rocketm   r#   r>   c                   C   r    )z' Test that "text" image can be loaded. N)r   textr   r   r   r   	test_textr   r#   r@   c                   C   r    )z4 Test that "stereo_motorcycle" image can be loaded. N)r   stereo_motorcycler   r   r   r   test_stereo_motorcyclew   r#   rB   c                  C   s   t jdd} t|  ddd t jddd} t|  ddd t jddd	d
} t|  ddd t jddd	d
}t| |krAJ d S )N   )lengthg      ?   )decimalg      ?)rD   volume_fraction    r   )rD   rG   n_dim)r   binary_blobsr   meanr-   all)blobsother_realizationr   r   r   test_binary_blobs|   s   rO   c                   C   r    )z& Test that "lfw_subset" can be loaded.N)r   
lfw_subsetr   r   r   r   test_lfw_subset   r#   rQ   c                  C   s   t  } | jdksJ dS )zJTest that "skin" image can be loaded.

    Needs internet connection.
    r   N)r   skinr   )rR   r   r   r   	test_skin   s   rS   c                   C   r    )z& Test that "cell" image can be loaded.N)r   cellr   r   r   r   	test_cell   r#   rU   c                  C   $   t d} t| }|jdksJ dS )Needs internet connection.zdata/cells3d.tif)<   r      rY   Nr   r   imreadr   pathimager   r   r   test_cells3d      
r_   c                  C   rV   )rW   zdata/brain.tiff)
   rY   rY   NrZ   r\   r   r   r   test_brain_3d   r`   rb   c                  C   "   t d t } | jdksJ dS )zdTest that 3D multichannel image of kidney tissue can be loaded.

    Needs internet connection.
    zdata/kidney.tif)   r   r   r   N)r   r   kidneyr   )re   r   r   r   test_kidney_3d_multichannel      rf   c                  C   rc   )zdTest that microscopy image of lily of the valley can be loaded.

    Needs internet connection.
    zdata/lily.tif)  rh   r6   N)r   r   lilyr   )ri   r   r   r   test_lily_multichannel   rg   rj   c                  C   s<   t d t d t \} }| |fD ]	}|jdksJ qd S )Nzdata/pivchallenge-B-B001_1.tifzdata/pivchallenge-B-B001_2.tif)r   r   )r   r   vortexr   )image0image1r^   r   r   r   test_vortex   s   rn   function_name	file_hashc                 C   s   t t| sJ d S )N)hasattrr   )ro   r   r   r   test_fetchers_are_public   s   rr   )+numpyr-   skimage.datar   skimage.data._fetchersr   skimager   skimage._shared.testingr   r   r   r   r   r   r   r   r"   r%   r'   r)   r.   r1   r3   r5   r8   r:   r<   r>   r@   rB   rO   rQ   rS   rU   r_   rb   rf   rj   rn   markparametrizerr   r   r   r   r   <module>   sJ    
	

