
    1-Ph#                        d dl Z d dlZd dlZddlmZmZ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mZ dd	lmZ g d
ZdZ eddde          defd            Z eddde          defd            Z eddde          efddd            Z eddd          dd            Z eddd          dd            Z e
dd           eddd          d                         ZdS )    N   )warndeprecate_funcdeprecate_parameter
DEPRECATED)require)is_low_contrast)rgb2grayrgba2rgb)call_plugin!_hide_plugin_deprecation_warnings   )file_or_url_context)imreadimsaveimshowshowimread_collectionimshow_collectionaQ  The plugin infrastructure in `skimage.io` and the parameter `{deprecated_name}` are deprecated since version {deprecated_version} and will be removed in {changed_version} (or later). To avoid this warning, please do not use the parameter `{deprecated_name}`. Instead, use `imageio` or other I/O packages directly. See also `{func_name}`.pluginz0.25z0.27)start_versionstop_versiontemplateFc                 2   |t           u rd}|rd}t          j        |t          d           t	          | t
          j                  r!t          |                                           } |9t          | d          r)| 
                                                    d          rd}t          |           5 } t                      5  t          d| fd	|i|}ddd           n# 1 swxY w Y   ddd           n# 1 swxY w Y   t          |d
          s|S |j        dk    r{|j        d         dvr;|j        d         dv r,t#          j        |dd          }t#          j        |dd          }|r/|j        d         dk    rt'          |          }t)          |          }|S )a  Load an image from file.

    Parameters
    ----------
    fname : str or pathlib.Path
        Image file name, e.g. ``test.jpg`` or URL.
    as_gray : bool, optional
        If True, convert color images to gray-scale (64-bit floats).
        Images that are already in gray-scale format are not converted.

    Other Parameters
    ----------------
    plugin_args : DEPRECATED
        The plugin infrastructure is deprecated.

    Returns
    -------
    img_array : ndarray
        The different color bands/channels are stored in the
        third dimension, such that a gray-image is MxN, an
        RGB-image MxNx3 and an RGBA-image MxNx4.

    Na-  The plugin infrastructure in `skimage.io` is deprecated since version 0.25 and will be removed in 0.27 (or later). To avoid this warning, please do not pass additional keyword arguments for plugins (`**plugin_args`). Instead, use `imageio` or other I/O packages directly. See also `skimage.io.imread`.   category
stacklevellowerz.tiffz.tiftifffiler   r   ndimr   )r      r$   )r   warningsr   FutureWarning
isinstancepathlibPathstrresolvehasattrr   endswithr   r   r   r"   shapenpswapaxesr   r
   )fnameas_grayr   plugin_argsmsgimgs         N/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/skimage/io/_io.pyr   r       s>   <  AC 	 	cMa@@@@%&& %EMMOO$$~'%11~;;==!!"344 	 F	U	#	# Iu.O.Q.Q I I(EHH&HKHHI I I I I I I I I I I I I I I I I I I I I I I I I I I I I I 3 

x!||9R=&&39R=F+B+B+c2r**C+c2r**C 	 y|q  smm3--CJs6   1C4 CC4C!	!C4$C!	%C44C8;C8Tc                     |t           u rd}|rd}t          j        |t          d           t	                      5  t          d| |fd|i|cddd           S # 1 swxY w Y   dS )a  
    Load a collection of images.

    Parameters
    ----------
    load_pattern : str or list
        List of objects to load. These are usually filenames, but may
        vary depending on the currently active plugin. See :class:`ImageCollection`
        for the default behaviour of this parameter.
    conserve_memory : bool, optional
        If True, never keep more than one in memory at a specific
        time.  Otherwise, images will be cached once they are loaded.

    Returns
    -------
    ic : :class:`ImageCollection`
        Collection of images.

    Other Parameters
    ----------------
    plugin_args : DEPRECATED
        The plugin infrastructure is deprecated.

    Na8  The plugin infrastructure in `skimage.io` is deprecated since version 0.25 and will be removed in 0.27 (or later). To avoid this warning, please do not pass additional keyword arguments for plugins (`**plugin_args`). Instead, use `imageio` or other I/O packages directly. See also `skimage.io.imread_collection`.r   r   r   r   )r   r'   r   r(   r   r   )load_patternconserve_memoryr   r5   r6   s        r8   r   r   d   s    B  AN 	 	cMa@@@@	*	,	, 
 

 
 	

 
 

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
s   AAA)check_contrastc                t   |t           u rd}|rd}t          j        |t          d           t	          | t
          j                  r!t          |                                           } |9t          | d          r)| 
                                                    d          rd}|j        t          k    r,t          |  dd	           |                    d
          dz  }|r!t          |          rt          |  d           t!                      5  t#          d| |fd|i|cddd           S # 1 swxY w Y   dS )a  Save an image to file.

    Parameters
    ----------
    fname : str or pathlib.Path
        Target filename.
    arr : ndarray of shape (M,N) or (M,N,3) or (M,N,4)
        Image data.
    check_contrast : bool, optional
        Check for low contrast and print warning (default: True).

    Other Parameters
    ----------------
    plugin_args : DEPRECATED
        The plugin infrastructure is deprecated.
    Na-  The plugin infrastructure in `skimage.io` is deprecated since version 0.25 and will be removed in 0.27 (or later). To avoid this warning, please do not pass additional keyword arguments for plugins (`**plugin_args`). Instead, use `imageio` or other I/O packages directly. See also `skimage.io.imsave`.r   r   r   r    r!   z~ is a boolean image: setting True to 255 and False to 0. To silence this warning, please convert the image using img_as_ubyte.)r   uint8   z is a low contrast imager   r   )r   r'   r   r(   r)   r*   r+   r,   r-   r.   r   r/   dtypeboolastyper	   r   r   )r3   arrr   r<   r5   r6   s         r8   r   r      s   .  AC 	 	cMa@@@@%&& %EMMOO$$~'%11~;;==!!"344 	 F
yD    		
 	
 	
 	
 jj!!C' 1/#.. 1///000	*	,	, O O8UCNNN+NNO O O O O O O O O O O O O O O O O Os   D--D14D1z<Please use `matplotlib`, `napari`, etc. to visualize images.)deprecated_versionremoved_versionhintc                     t          | t                    rt          d| |          } t                      5  t          d| fd|i|cddd           S # 1 swxY w Y   dS )a  Display an image.

    Parameters
    ----------
    arr : ndarray or str
        Image data or name of image file.
    plugin : str
        Name of plugin to use.  By default, the different plugins are
        tried (starting with imageio) until a suitable candidate is found.

    Other Parameters
    ----------------
    plugin_args : keywords
        Passed to the given plugin.

    r   )r   r   r   N)r)   r,   r   r   )rC   r   r5   s      r8   r   r      s    , #s 8(C777	*	,	, H H8SGGG;GGH H H H H H H H H H H H H H H H H Hs   AAAc                 r    t                      5  t          d| fd|i|cddd           S # 1 swxY w Y   dS )zDisplay a collection of images.

    Parameters
    ----------
    ic : :class:`ImageCollection`
        Collection to display.

    Other Parameters
    ----------------
    plugin_args : keywords
        Passed to the given plugin.

    r   r   Nr   r   )icr   r5   s      r8   r   r      s    & 
+	,	, R R.QQ6Q[QQR R R R R R R R R R R R R R R R R Rs   ,00
matplotlibz>=3.3c                  p    t                      5  t          d          cddd           S # 1 swxY w Y   dS )ah  Display pending images.

    Launch the event loop of the current GUI plugin, and display all
    pending images, queued via `imshow`. This is required when using
    `imshow` from non-interactive scripts.

    A call to `show` will block execution of code until all windows
    have been closed.

    Examples
    --------
    .. testsetup::
        >>> import pytest; _ = pytest.importorskip('matplotlib')

    >>> import skimage.io as io
    >>> rng = np.random.default_rng()
    >>> for i in range(4):
    ...     ax_im = io.imshow(rng.random((50, 50)))  # doctest: +SKIP
    >>> io.show() # doctest: +SKIP

    	_app_showNrI        r8   r   r     s    8 
+	,	, ( (;''( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( (s   +//)N)r*   r'   numpyr1   _shared.utilsr   r   r   r   _shared.version_requirementsr   exposurer	   color.colorconvr
   r   io.manage_pluginsr   r   utilr   __all___remove_plugin_param_templater   r   r   r   r   r   rN   rO   r8   <module>rY      s         Q Q Q Q Q Q Q Q Q Q Q Q 2 2 2 2 2 2 & & & & & & 0 0 0 0 0 0 0 0 N N N N N N N N % % % % % %  >  *	    
 ; ; ; ;| *	   #'z-
 -
 -
 -
` *	   ) .OD .O .O .O .O .Ob 	G  
H H H 
H. 	G  
R R R 
R$ 	w	G  
( (   ( ( (rO   