
    9i	                     ,    S r SSKrSSKJr  S/rSS jrg)zb
The arraycrop module contains functions to crop values from the edges of an
n-dimensional array.
    N)Integralcropc                   ^  [         R                  " T SS9m [        U[        5      (       a  X//T R                  -  nO[        US   [        5      (       a`  [        U5      S:X  a  US   US   //T R                  -  nO[        U5      S:X  a  U/T R                  -  nOo[        S[        U5       S35      e[        U5      S:X  a  US   /T R                  -  nO4[        U5      T R                  :X  a  UnO[        S[        U5       S35      e[        U 4S j[        U5       5       5      nU(       a  [         R                  " T U   US	S
9nU$ T U   nU$ )a  Crop array `ar` by `crop_width` along each dimension.

Parameters
----------
ar : array-like of rank N
    Input array.
crop_width : {sequence, int}
    Number of values to remove from the edges of each axis.
    ``((before_1, after_1),`` ... ``(before_N, after_N))`` specifies
    unique crop widths at the start and end of each axis.
    ``((before, after),) or (before, after)`` specifies
    a fixed start and end crop for every axis.
    ``(n,)`` or ``n`` for integer ``n`` is a shortcut for
    before = after = ``n`` for all axes.
copy : bool, optional
    If `True`, ensure the returned array is a contiguous copy. Normally,
    a crop operation will return a discontiguous view of the underlying
    input array.
order : {'C', 'F', 'A', 'K'}, optional
    If ``copy==True``, control the memory layout of the copy. See
    ``np.copy``.

Returns
-------
cropped : array
    The cropped array. If ``copy=False`` (default), this is a sliced
    view of the input array.
F)copyr         z"crop_width has an invalid length: zO
crop_width should be a sequence of N pairs, a single pair, or a single integerc              3   f   >#    U  H&  u  nu  p#[        UTR                  U   U-
  5      v   M(     g 7f)N)sliceshape).0iabars       V/var/www/html/land-doc-ocr/venv/lib/python3.13/site-packages/skimage/util/arraycrop.py	<genexpr>crop.<locals>.<genexpr>C   s/     O>NFQ5BHHQK!O,,>Ns   .1T)orderr   )	nparray
isinstancer   ndimlen
ValueErrortuple	enumerate)r   
crop_widthr   r   cropsslicescroppeds   `      r   r   r      sS   : 
"5	!B*h'')*RWW4	JqM8	,	,z?a mZ]34rww>E_!L277*E4S_4E F5 6 
 
ZA	A"'')	ZBGG	#0Z0A B1 2
 	
 Oi>NOOF((2f:U> N V*N    )FK)__doc__numpyr   numbersr   __all__r    r!   r   <module>r(      s   
  (<r!   