
    (ph1                        S SK rSSKJr  SSKJr  SSKJr  SSKJr  / SQrSS jrSS	 jr	SS
.S jr
 S S jrS rS!S jrSS jrSS jrSS jrSS jrSS jr   S"S jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrSS jrg)#    N   )_ni_support)	_ni_label)	_nd_image)_morphology)labelfind_objectslabeled_comprehensionsummeanvariancestandard_deviationminimummaximummedianminimum_positionmaximum_positionextremacenter_of_mass	histogramwatershed_ift
sum_labelsvalue_indicesc                 L   [         R                  " U 5      n [         R                  " U 5      (       a  [        S5      eUc!  [        R
                  " U R                  S5      n[         R                  " U[        S9nUR                  U R                  :w  a  [        S5      eUR                   H  nUS:w  d  M  [        S5      e   U R                  S:  n[        U[         R                  5      (       a(  UR                  U R                  :w  a  [        S	5      eS
nOmSnUcG  [         R                  " U R                  U(       a  [         R                  O[         R                   5      nO![         R                  " U R                  U5      nU R                  S:X  d  U R                  S:X  a-  U R                  S:X  a  U S:w  a  SOSnXbS'   OSnU(       a  U$ X&4$  ["        R$                  " XU5      nU(       a  U$ X'4$ ! ["        R&                   a  n[         R                  " U R                  U(       a  [         R                  O[         R                   5      n	["        R$                  " XU	5      nU	S   US'   [         R(                  " X):H  5      (       d  [        S5      Ue SnANSnAff = f)a  
Label features in an array.

Parameters
----------
input : array_like
    An array-like object to be labeled. Any non-zero values in `input` are
    counted as features and zero values are considered the background.
structure : array_like, optional
    A structuring element that defines feature connections.
    `structure` must be centrosymmetric
    (see Notes).
    If no structuring element is provided,
    one is automatically generated with a squared connectivity equal to
    one.  That is, for a 2-D `input` array, the default structuring element
    is::

        [[0,1,0],
         [1,1,1],
         [0,1,0]]

output : (None, data-type, array_like), optional
    If `output` is a data type, it specifies the type of the resulting
    labeled feature array.
    If `output` is an array-like object, then `output` will be updated
    with the labeled features from this function.  This function can
    operate in-place, by passing output=input.
    Note that the output must be able to store the largest label, or this
    function will raise an Exception.

Returns
-------
label : ndarray or int
    An integer ndarray where each unique feature in `input` has a unique
    label in the returned array.
num_features : int
    How many objects were found.

    If `output` is None, this function returns a tuple of
    (`labeled_array`, `num_features`).

    If `output` is a ndarray, then it will be updated with values in
    `labeled_array` and only `num_features` will be returned by this
    function.

See Also
--------
find_objects : generate a list of slices for the labeled features (or
               objects); useful for finding features' position or
               dimensions

Notes
-----
A centrosymmetric matrix is a matrix that is symmetric about the center.
See [1]_ for more information.

The `structure` matrix must be centrosymmetric to ensure
two-way connections.
For instance, if the `structure` matrix is not centrosymmetric
and is defined as::

    [[0,1,0],
     [1,1,0],
     [0,0,0]]

and the `input` is::

    [[1,2],
     [0,3]]

then the structure matrix would indicate the
entry 2 in the input is connected to 1,
but 1 is not connected to 2.

References
----------
.. [1] James R. Weaver, "Centrosymmetric (cross-symmetric)
   matrices, their basic properties, eigenvalues, and
   eigenvectors." The American Mathematical Monthly 92.10
   (1985): 711-717.

Examples
--------
Create an image with some features, then label it using the default
(cross-shaped) structuring element:

>>> from scipy.ndimage import label, generate_binary_structure
>>> import numpy as np
>>> a = np.array([[0,0,1,1,0,0],
...               [0,0,0,1,0,0],
...               [1,1,0,0,1,0],
...               [0,0,0,1,0,0]])
>>> labeled_array, num_features = label(a)

Each of the 4 features are labeled with a different integer:

>>> num_features
4
>>> labeled_array
array([[0, 0, 1, 1, 0, 0],
       [0, 0, 0, 1, 0, 0],
       [2, 2, 0, 0, 3, 0],
       [0, 0, 0, 4, 0, 0]], dtype=int32)

Generate a structuring element that will consider features connected even
if they touch diagonally:

>>> s = generate_binary_structure(2,2)

or,

>>> s = [[1,1,1],
...      [1,1,1],
...      [1,1,1]]

Label the image using the new structuring element:

>>> labeled_array, num_features = label(a, structure=s)

Show the 2 labeled features (note that features 1, 3, and 4 from above are
now considered a single feature):

>>> num_features
2
>>> labeled_array
array([[0, 0, 1, 1, 0, 0],
       [0, 0, 0, 1, 0, 0],
       [2, 2, 0, 0, 1, 0],
       [0, 0, 0, 1, 0, 0]], dtype=int32)

Complex type not supportedNr   dtype(structure and input must have equal rank   'structure dimensions must be equal to 3izoutput shape not correctTFr   .z/insufficient bit-depth in requested output type)npasarrayiscomplexobj	TypeErrorr   generate_binary_structurendimboolRuntimeErrorshape
ValueErrorsize
isinstancendarrayemptyintpint32r   _labelNeedMoreBitsall)
input	structureoutputiineed_64bitscaller_provided_outputmaxlabel	max_labele
tmp_outputs
             N/var/www/html/venv/lib/python3.13/site-packages/scipy/ndimage/_measurements.pyr   r   +   s   H JJuE	u45599%**aH	

9D1I~~#EFFoo7FGG  **+K&"**%%<<5;;&788!%!&>XXekkk277rxxPFXXekk62F zzQ%**/::?"aZqaH"3K H!O##$$Uv>	   ! !! 
 XXekkk277rxxP
$$UzB	 osvvf*++A ,
s   G7 7J#BJJ#c                     [         R                  " U 5      n [         R                  " U 5      (       a  [        S5      eUS:  a  U R	                  5       n[
        R                  " X5      $ )a  
Find objects in a labeled array.

Parameters
----------
input : ndarray of ints
    Array containing objects defined by different labels. Labels with
    value 0 are ignored.
max_label : int, optional
    Maximum label to be searched for in `input`. If max_label is not
    given, the positions of all objects are returned.

Returns
-------
object_slices : list of tuples
    A list of tuples, with each tuple containing N slices (with N the
    dimension of the input array). Slices correspond to the minimal
    parallelepiped that contains the object. If a number is missing,
    None is returned instead of a slice. The label ``l`` corresponds to
    the index ``l-1`` in the returned list.

See Also
--------
label, center_of_mass

Notes
-----
This function is very useful for isolating a volume of interest inside
a 3-D array, that cannot be "seen through".

Examples
--------
>>> from scipy import ndimage
>>> import numpy as np
>>> a = np.zeros((6,6), dtype=int)
>>> a[2:4, 2:4] = 1
>>> a[4, 4] = 1
>>> a[:2, :3] = 2
>>> a[0, 5] = 3
>>> a
array([[2, 2, 2, 0, 0, 3],
       [2, 2, 2, 0, 0, 0],
       [0, 0, 1, 1, 0, 0],
       [0, 0, 1, 1, 0, 0],
       [0, 0, 0, 0, 1, 0],
       [0, 0, 0, 0, 0, 0]])
>>> ndimage.find_objects(a)
[(slice(2, 5, None), slice(2, 5, None)),
 (slice(0, 2, None), slice(0, 3, None)),
 (slice(0, 1, None), slice(5, 6, None))]
>>> ndimage.find_objects(a, max_label=2)
[(slice(2, 5, None), slice(2, 5, None)), (slice(0, 2, None), slice(0, 3, None))]
>>> ndimage.find_objects(a == 1, max_label=2)
[(slice(2, 5, None), slice(2, 5, None)), None]

>>> loc = ndimage.find_objects(a)[0]
>>> a[loc]
array([[1, 1, 0],
       [1, 1, 0],
       [0, 0, 1]])

r   r   )r!   r"   r#   r$   maxr   r	   )r4   r;   s     r>   r	   r	      sQ    ~ JJuE	u4551}IIK	!!%33    )ignore_valuec                    [         R                  " U 5      n [         R                  " SU R                  S9nUSL nU(       d  UR                  R	                  U5      US'   [
        R                  " XU5      nU$ )aB  
Find indices of each distinct value in given array.

Parameters
----------
arr : ndarray of ints
    Array containing integer values.
ignore_value : int, optional
    This value will be ignored in searching the `arr` array. If not
    given, all values found will be included in output. Default
    is None.

Returns
-------
indices : dictionary
    A Python dictionary of array indices for each distinct value. The
    dictionary is keyed by the distinct values, the entries are array
    index tuples covering all occurrences of the value within the
    array.

    This dictionary can occupy significant memory, usually several times
    the size of the input array.

See Also
--------
label, maximum, median, minimum_position, extrema, sum, mean, variance,
standard_deviation, numpy.where, numpy.unique

Notes
-----
For a small array with few distinct values, one might use
`numpy.unique()` to find all possible values, and ``(arr == val)`` to
locate each value within that array. However, for large arrays,
with many distinct values, this can become extremely inefficient,
as locating each value would require a new search through the entire
array. Using this function, there is essentially one search, with
the indices saved for all distinct values.

This is useful when matching a categorical image (e.g. a segmentation
or classification) to an associated image of other data, allowing
any per-class statistic(s) to then be calculated. Provides a
more flexible alternative to functions like ``scipy.ndimage.mean()``
and ``scipy.ndimage.variance()``.

Some other closely related functionality, with different strengths and
weaknesses, can also be found in ``scipy.stats.binned_statistic()`` and
the `scikit-image <https://scikit-image.org/>`_ function
``skimage.measure.regionprops()``.

Note for IDL users: this provides functionality equivalent to IDL's
REVERSE_INDICES option (as per the IDL documentation for the
`HISTOGRAM <https://www.l3harrisgeospatial.com/docs/histogram.html>`_
function).

.. versionadded:: 1.10.0

Examples
--------
>>> import numpy as np
>>> from scipy import ndimage
>>> a = np.zeros((6, 6), dtype=int)
>>> a[2:4, 2:4] = 1
>>> a[4, 4] = 1
>>> a[:2, :3] = 2
>>> a[0, 5] = 3
>>> a
array([[2, 2, 2, 0, 0, 3],
       [2, 2, 2, 0, 0, 0],
       [0, 0, 1, 1, 0, 0],
       [0, 0, 1, 1, 0, 0],
       [0, 0, 0, 0, 1, 0],
       [0, 0, 0, 0, 0, 0]])
>>> val_indices = ndimage.value_indices(a)

The dictionary `val_indices` will have an entry for each distinct
value in the input array.

>>> val_indices.keys()
dict_keys([np.int64(0), np.int64(1), np.int64(2), np.int64(3)])

The entry for each value is an index tuple, locating the elements
with that value.

>>> ndx1 = val_indices[1]
>>> ndx1
(array([2, 2, 3, 3, 4]), array([2, 3, 2, 3, 4]))

This can be used to index into the original array, or any other
array with the same shape.

>>> a[ndx1]
array([1, 1, 1, 1, 1])

If the zeros were to be ignored, then the resulting dictionary
would no longer have an entry for zero.

>>> val_indices = ndimage.value_indices(a, ignore_value=0)
>>> val_indices.keys()
dict_keys([np.int64(1), np.int64(2), np.int64(3)])

)r   r   Nr   )r!   r"   zerosr   typer   r   )arrrB   ignore_value_arrignoreIsNoneval_indicess        r>   r   r   7  si    R **S/CxxCII6 D(L.4499,G))#=MNKrA   c                   ^^^ [         R                  " U5      n[         R                  " U 5      n U(       a9  [         R                  " U R                  5      R                  U R                  5      nTcP  Ub  [        S5      eU(       d  T" U R                  5       5      $ T" U R                  5       WR                  5       5      $ [         R                  " T5      m [         R                  " U T5      u  n mUc*  U(       d  T" U TS:     5      $ T" U TS:     WTS:     5      $ [         R                  " U5      n[         R                  " UR                  TR                  5      R                  UR                  5      U:g  5      (       a&  [        SUR                   STR                   S35      eUR                  TR                  5      nUR                  5       n
UR                  5       nTU
:  TU:*  -  nTU   mX   n U(       a  WU   nTR!                  5       nTU   mX   n U(       a  WU   nUR!                  5       nX.   mUUU4S jn[         R"                  " UR                  U5      nUUSS& U(       d  U" U /U5        OU" U W/U5        [         R$                  " UR                  U5      nUUU'   U(       a  US   nU$ ! [         a  n	[        S5      U	eSn	A	ff = f)	a-  
Roughly equivalent to [func(input[labels == i]) for i in index].

Sequentially applies an arbitrary function (that works on array_like input)
to subsets of an N-D image array specified by `labels` and `index`.
The option exists to provide the function with positional parameters as the
second argument.

Parameters
----------
input : array_like
    Data from which to select `labels` to process.
labels : array_like or None
    Labels to objects in `input`.
    If not None, array must be same shape as `input`.
    If None, `func` is applied to raveled `input`.
index : int, sequence of ints or None
    Subset of `labels` to which to apply `func`.
    If a scalar, a single value is returned.
    If None, `func` is applied to all non-zero values of `labels`.
func : callable
    Python function to apply to `labels` from `input`.
out_dtype : dtype
    Dtype to use for `result`.
default : int, float or None
    Default return value when a element of `index` does not exist
    in `labels`.
pass_positions : bool, optional
    If True, pass linear indices to `func` as a second argument.
    Default is False.

Returns
-------
result : ndarray
    Result of applying `func` to each of `labels` to `input` in `index`.

Examples
--------
>>> import numpy as np
>>> a = np.array([[1, 2, 0, 0],
...               [5, 3, 0, 4],
...               [0, 0, 0, 7],
...               [9, 3, 0, 0]])
>>> from scipy import ndimage
>>> lbl, nlbl = ndimage.label(a)
>>> lbls = np.arange(1, nlbl+1)
>>> ndimage.labeled_comprehension(a, lbl, lbls, np.mean, float, 0)
array([ 2.75,  5.5 ,  6.  ])

Falling back to `default`:

>>> lbls = np.arange(1, nlbl+2)
>>> ndimage.labeled_comprehension(a, lbl, lbls, np.mean, float, -1)
array([ 2.75,  5.5 ,  6.  , -1.  ])

Passing positions:

>>> def fn(val, pos):
...     print("fn says: %s : %s" % (val, pos))
...     return (val.sum()) if (pos.sum() % 2 == 0) else (-val.sum())
...
>>> ndimage.labeled_comprehension(a, lbl, lbls, fn, float, 0, True)
fn says: [1 2 5 3] : [0 1 4 5]
fn says: [4 7] : [ 7 11]
fn says: [9 3] : [12 13]
array([ 11.,  11., -12.,   0.])

Nzindex without defined labelszMinput and labels must have the same shape (excepting dimensions with width 1)r   z"Cannot convert index values from <z> to <z*> (labels' type) without loss of precisionc           	         > TR                   n[        R                  " T
TSS9n[        R                  " T
TSS9n[        [	        U5      X45       H&  u  pVnXg:X  a  M  T	" U  Vs/ s H  oXg PM     sn6 X'   M(     gs  snf )zlabels must be sortedleft)siderightN)r+   r!   searchsortedziprange)inputsr6   nidxlohiilhinpfunclabelssorted_indexs            r>   do_map%labeled_comprehension.<locals>.do_map*  sw       __V\?__V\@5;/GA!v6:6C1x6:;FI 0 ;s   "A:
)r!   isscalarr"   aranger+   reshaper)   r*   ravelbroadcast_arrays
atleast_1danyastyper   minr@   argsortr.   rD   )r4   r[   indexrZ   	out_dtypedefaultpass_positions	as_scalar	positionsr<   rT   rU   masklabel_orderindex_orderr]   tempr6   r\   s    ` `              @r>   r
   r
     s   N E"IJJuEIIejj)11%++>	~;<<&&y'899ZZFJ++E6:v
 }fqj)**fqj)9VaZ+@AAMM% E	vvell6<<(//<EFF=ekk] K#\\N*TV W 	W LL&E 
B	BbLVr\*D D\FKEdO	 .."KK FEk*	--/K%L< 88EKK+DDGwy!4(XXekk9-FF;MC  J B CHI	JJs   K   
K
KKc                 H   [         R                  " [        5      R                  n[         R                  " U [         R
                  5      =(       a    U R                  U:*  =(       d;    [         R                  " U [         R                  5      =(       a    U R                  U:  nU$ )zCTest whether the NumPy data type `dt` can be safely cast to an int.)r!   r   intitemsize
issubdtypesignedintegerunsignedinteger)dtint_sizesafes      r>   _safely_castable_to_intr|   G  si    xx}%%H]]2r//0LR[[H5L O]]2r112Mr{{X7M 	KrA   c                   ^ ^^^ U4S jn[         R                  " T 5      m Uc  U" T 5      $ [         R                  " T U5      u  m nUc  U" T US:     5      $ [         R                  " U5      (       a  U" T X:H     5      $ UU U4S jn[	        UR
                  5      (       a2  UR                  5       S:  d  UR                  5       UR                  :  a  [         R                  " USS9u  pg[         R                  " US5      n[         R                  " U5      m[         R                  " UT R                  5       S9mT(       a!  U" UR                  UR                  5      5      n[         R                  " Xb5      n	SXUR                  :  '   Xi   U:H  n
O[         R                  " UR                  5       5      m[         R                  " UR                  5       T R                  5       S9mT(       a  U" U5      n[         R                  " U[         R                   5      R#                  5       n	U	S:  U	TR                  :  -  n
SX) '   TU	   mSTU
) '   TU	   mSTU
) '   T(       d  TT4$ WU	   nSX) '   TTU4$ )av  Count, sum, and optionally compute (sum - centre)^2 of input by label

Parameters
----------
input : array_like, N-D
    The input data to be analyzed.
labels : array_like (N-D), optional
    The labels of the data in `input`. This array must be broadcast
    compatible with `input`; typically, it is the same shape as `input`.
    If `labels` is None, all nonzero values in `input` are treated as
    the single labeled group.
index : label or sequence of labels, optional
    These are the labels of the groups for which the stats are computed.
    If `index` is None, the stats are computed for the single group where
    `labels` is greater than 0.
centered : bool, optional
    If True, the centered sum of squares for each labeled group is
    also returned. Default is False.

Returns
-------
counts : int or ndarray of ints
    The number of elements in each labeled group.
sums : scalar or ndarray of scalars
    The sums of the values in each labeled group.
sums_c : scalar or ndarray of scalars, optional
    The sums of mean-centered squares of the values in each labeled group.
    This is only returned if `centered` is True.

c                    > T(       aM  X R                  5       -
  nU R                  U R                  5       XR                  5       -  R                  5       4$ U R                  U R                  5       4$ )N)r   r+   r   	conjugate)valsvals_ccentereds     r>   single_group_stats.<locals>.single_groupn  sU    IIK'F99dhhj64D4D4F+F*K*K*MMM99dhhj((rA   r   c                    > TT-  nTX   -
  n[         R                  " U R                  5       UUR                  5       -  R                  5       S9nU$ )Nweights)r!   bincountrb   r   )r[   meanscentered_inputbccountsr4   sumss       r>   _sum_centered_stats.<locals>._sum_centered  sT     v.[['5'5'?'?'A(BCH57L 	rA   Treturn_inverse)r   )r!   r"   rc   r_   r|   r   rg   r@   r+   uniquera   r   rb   r)   rO   
asanyarrayint_copy)r4   r[   ri   r   r   r   unique_labels
new_labelssums_cidxsfoundr   r   s   `  `       @@r>   _statsr   O  s   >) JJuE~E"" ''v6ME6}E&1*-..	{{5E&/233
 $FLL11JJL1

v{{ : %'IIfT$J!ZZ
E2
Z({{:u{{}= #:#5#5fll#CDF}4+,]'''($- V\\^,{{6<<>5;;=A"6*F}}UBGG,113tfkk12VD\FFE6N:DD%L~vf%%rA   c                     [        XU5      $ )z
Calculate the sum of the values of the array.

Notes
-----
This is an alias for `ndimage.sum_labels` kept for backwards compatibility
reasons, for new code please prefer `sum_labels`.  See the `sum_labels`
docstring for more details.

)r   r4   r[   ri   s      r>   r   r     s     eU++rA   c                 "    [        XU5      u  p4U$ )a  
Calculate the sum of the values of the array.

Parameters
----------
input : array_like
    Values of `input` inside the regions defined by `labels`
    are summed together.
labels : array_like of ints, optional
    Assign labels to the values of the array. Has to have the same shape as
    `input`.
index : array_like, optional
    A single label number or a sequence of label numbers of
    the objects to be measured.

Returns
-------
sum : ndarray or scalar
    An array of the sums of values of `input` inside the regions defined
    by `labels` with the same shape as `index`. If 'index' is None or scalar,
    a scalar is returned.

See Also
--------
mean, median

Examples
--------
>>> from scipy import ndimage
>>> input =  [0,1,2,3]
>>> labels = [1,1,2,2]
>>> ndimage.sum_labels(input, labels, index=[1,2])
[1.0, 5.0]
>>> ndimage.sum_labels(input, labels, index=1)
1
>>> ndimage.sum_labels(input, labels)
6


)r   r4   r[   ri   countr   s        r>   r   r     s    R u-JEJrA   c                     [        XU5      u  p4U[        R                  " U5      R                  [        R                  5      -  $ )a  
Calculate the mean of the values of an array at labels.

Parameters
----------
input : array_like
    Array on which to compute the mean of elements over distinct
    regions.
labels : array_like, optional
    Array of labels of same shape, or broadcastable to the same shape as
    `input`. All elements sharing the same label form one region over
    which the mean of the elements is computed.
index : int or sequence of ints, optional
    Labels of the objects over which the mean is to be computed.
    Default is None, in which case the mean for all values where label is
    greater than 0 is calculated.

Returns
-------
out : list
    Sequence of same length as `index`, with the mean of the different
    regions labeled by the labels in `index`.

See Also
--------
variance, standard_deviation, minimum, maximum, sum, label

Examples
--------
>>> from scipy import ndimage
>>> import numpy as np
>>> a = np.arange(25).reshape((5,5))
>>> labels = np.zeros_like(a)
>>> labels[3:5,3:5] = 1
>>> index = np.unique(labels)
>>> labels
array([[0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0],
       [0, 0, 0, 0, 0],
       [0, 0, 0, 1, 1],
       [0, 0, 0, 1, 1]])
>>> index
array([0, 1])
>>> ndimage.mean(a, labels=labels, index=index)
[10.285714285714286, 21.0]

)r   r!   r   rf   float64r   s        r>   r   r     s6    b u-JEu%,,RZZ888rA   c                 v    [        XUSS9u  p4nU[        R                  " U5      R                  [        5      -  $ )a  
Calculate the variance of the values of an N-D image array, optionally at
specified sub-regions.

Parameters
----------
input : array_like
    Nd-image data to process.
labels : array_like, optional
    Labels defining sub-regions in `input`.
    If not None, must be same shape as `input`.
index : int or sequence of ints, optional
    `labels` to include in output.  If None (default), all values where
    `labels` is non-zero are used.

Returns
-------
variance : float or ndarray
    Values of variance, for each sub-region if `labels` and `index` are
    specified.

See Also
--------
label, standard_deviation, maximum, minimum, extrema

Examples
--------
>>> import numpy as np
>>> a = np.array([[1, 2, 0, 0],
...               [5, 3, 0, 4],
...               [0, 0, 0, 7],
...               [9, 3, 0, 0]])
>>> from scipy import ndimage
>>> ndimage.variance(a)
7.609375

Features to process can be specified using `labels` and `index`:

>>> lbl, nlbl = ndimage.label(a)
>>> ndimage.variance(a, lbl, index=np.arange(1, nlbl+1))
array([ 2.1875,  2.25  ,  9.    ])

If no index is given, all non-zero `labels` are processed:

>>> ndimage.variance(a, lbl)
6.1875

T)r   )r   r!   r   rf   float)r4   r[   ri   r   r   sum_c_sqs         r>   r   r   ,  s7    b "%FEbmmE*11%888rA   c                 B    [         R                  " [        XU5      5      $ )a  
Calculate the standard deviation of the values of an N-D image array,
optionally at specified sub-regions.

Parameters
----------
input : array_like
    N-D image data to process.
labels : array_like, optional
    Labels to identify sub-regions in `input`.
    If not None, must be same shape as `input`.
index : int or sequence of ints, optional
    `labels` to include in output. If None (default), all values where
    `labels` is non-zero are used.

Returns
-------
standard_deviation : float or ndarray
    Values of standard deviation, for each sub-region if `labels` and
    `index` are specified.

See Also
--------
label, variance, maximum, minimum, extrema

Examples
--------
>>> import numpy as np
>>> a = np.array([[1, 2, 0, 0],
...               [5, 3, 0, 4],
...               [0, 0, 0, 7],
...               [9, 3, 0, 0]])
>>> from scipy import ndimage
>>> ndimage.standard_deviation(a)
2.7585095613392387

Features to process can be specified using `labels` and `index`:

>>> lbl, nlbl = ndimage.label(a)
>>> ndimage.standard_deviation(a, lbl, index=np.arange(1, nlbl+1))
array([ 1.479,  1.5  ,  3.   ])

If no index is given, non-zero `labels` are processed:

>>> ndimage.standard_deviation(a, lbl)
2.4874685927665499

)r!   sqrtr   r   s      r>   r   r   a  s    b 778E5122rA   c                 Z
  ^^^^^ [         R                  " U 5      n T=(       d    TnSn	U(       a9  [         R                  " U R                  5      R	                  U R
                  5      n	UUUUU4S jn
Uc  U
" X	5      $ [         R                  " X5      u  pUc  US:  nSnU(       a  X   nU
" X   U5      $ [         R                  " U5      (       a  X:H  nSnU(       a  X   nU
" X   U5      $ [         R                  " U5      n[        UR                  5      (       a2  UR                  5       S:  d  UR                  5       UR                  :  aF  [         R                  " USS9u  p[         R                  " X5      nSXUR                  :  '   X   U:H  nOK[         R                  " U[         R                  5      R!                  5       nUS:  XR                  5       :*  -  nUR                  5       S-   X) '   T(       a5  [         R"                  " U R%                  5       UR%                  5       45      nOU R%                  5       R'                  5       nU R%                  5       U   n UR%                  5       U   nU(       a  U	R%                  5       U   n	/ nT(       aL  [         R(                  " UR                  5       S-   U R                  5      nU SSS2   UUSSS2   '   UUU   /-  nT(       aF  [         R(                  " UR                  5       S-   [*        5      nU	SSS2   UUSSS2   '   UUU   /-  nT(       a@  [         R(                  " UR                  5       S-   U R                  5      nU UU'   UUU   /-  nT(       a:  [         R(                  " UR                  5       S-   [*        5      nU	UU'   UUU   /-  nT(       Gai  [         R                  " [-        U5      5      n[         R(                  " UR                  5       S-   [         R                  5      nUSSS2   UUSSS2   '   [         R(                  " UR                  5       S-   [         R                  5      nUUU'   UU   nUU   nUU-
  S-  nUU-  nUU-  n[         R.                  " U R                  [         R0                  5      (       d4  [         R.                  " U R                  [         R2                  5      (       a2  UU U   R5                  S	5      U U   R5                  S	5      -   S
-  /-  nU$ UU U   U U   -   S
-  /-  nU$ )zKReturns min, max, or both, plus their positions (if requested), and
median.Nc                 >  > / nT(       a  X R                  5       /-  nT(       a  X!X R                  5       :H     S   /-  nT(       a  X R                  5       /-  nT(       a  X!X R                  5       :H     S   /-  nT(       a  U[        R                  " U 5      /-  nU$ Nr   )rg   r@   r!   r   )r   rn   resultfind_maxfind_max_positionsfind_medianfind_minfind_min_positionss      r>   r   _select.<locals>.single_group  s    xxzl"F!34Q788Fxxzl"F!34Q788Fryy''FrA   r   Tr   r      r   dg       @)r!   r   r`   r+   ra   r)   rc   r_   r"   r|   r   rg   r@   r   rO   r   r   lexsortrb   rh   rD   rt   lenrv   integerbool_rf   )r4   r[   ri   r   r   r   r   r   find_positionsrn   r   ro   masked_positionsr   r   r   orderr   minsminposmaxsmaxposlocsrT   rU   steps      `````                  r>   _selectr     sZ    MM% E'=+=NIIIejj)11%++>	  ~E-- ''6ME}
(EK)9::	{{5(EK)9::JJuE $FLL11JJL1

v{{ : "		& F}4 ,-]'''($- }}UBGG,113tzz|34JJL1$DM

EKKM6<<>:;%%'KKM% E\\^E"FOO%e,	Fxx

q(%++6"4R4[VDbD\4:,&**,*C0(2vdd|6$<. xx

q(%++6V4:,&**,*C0"v6$<. yyV%XXfjjlQ&0":6$B$<XXfjjlQ&06
XX
 RA~
d

d
MM%++rzz22==bhh77b	((-b	0@0@0EELMMF M b	E"I-455FMrA   c                     [        XUSS9S   $ )a#  
Calculate the minimum of the values of an array over labeled regions.

Parameters
----------
input : array_like
    Array_like of values. For each region specified by `labels`, the
    minimal values of `input` over the region is computed.
labels : array_like, optional
    An array_like of integers marking different regions over which the
    minimum value of `input` is to be computed. `labels` must have the
    same shape as `input`. If `labels` is not specified, the minimum
    over the whole array is returned.
index : array_like, optional
    A list of region labels that are taken into account for computing the
    minima. If index is None, the minimum over all elements where `labels`
    is non-zero is returned.

Returns
-------
minimum : float or list of floats
    List of minima of `input` over the regions determined by `labels` and
    whose index is in `index`. If `index` or `labels` are not specified, a
    float is returned: the minimal value of `input` if `labels` is None,
    and the minimal value of elements where `labels` is greater than zero
    if `index` is None.

See Also
--------
label, maximum, median, minimum_position, extrema, sum, mean, variance,
standard_deviation

Notes
-----
The function returns a Python list and not a NumPy array, use
`np.array` to convert the list to an array.

Examples
--------
>>> from scipy import ndimage
>>> import numpy as np
>>> a = np.array([[1, 2, 0, 0],
...               [5, 3, 0, 4],
...               [0, 0, 0, 7],
...               [9, 3, 0, 0]])
>>> labels, labels_nb = ndimage.label(a)
>>> labels
array([[1, 1, 0, 0],
       [1, 1, 0, 2],
       [0, 0, 0, 2],
       [3, 3, 0, 0]], dtype=int32)
>>> ndimage.minimum(a, labels=labels, index=np.arange(1, labels_nb + 1))
[1, 4, 3]
>>> ndimage.minimum(a)
0
>>> ndimage.minimum(a, labels=labels)
1

T)r   r   r   r   s      r>   r   r     s    x 5%$7::rA   c                     [        XUSS9S   $ )a  
Calculate the maximum of the values of an array over labeled regions.

Parameters
----------
input : array_like
    Array_like of values. For each region specified by `labels`, the
    maximal values of `input` over the region is computed.
labels : array_like, optional
    An array of integers marking different regions over which the
    maximum value of `input` is to be computed. `labels` must have the
    same shape as `input`. If `labels` is not specified, the maximum
    over the whole array is returned.
index : array_like, optional
    A list of region labels that are taken into account for computing the
    maxima. If index is None, the maximum over all elements where `labels`
    is non-zero is returned.

Returns
-------
output : float or list of floats
    List of maxima of `input` over the regions determined by `labels` and
    whose index is in `index`. If `index` or `labels` are not specified, a
    float is returned: the maximal value of `input` if `labels` is None,
    and the maximal value of elements where `labels` is greater than zero
    if `index` is None.

See Also
--------
label, minimum, median, maximum_position, extrema, sum, mean, variance,
standard_deviation

Notes
-----
The function returns a Python list and not a NumPy array, use
`np.array` to convert the list to an array.

Examples
--------
>>> import numpy as np
>>> a = np.arange(16).reshape((4,4))
>>> a
array([[ 0,  1,  2,  3],
       [ 4,  5,  6,  7],
       [ 8,  9, 10, 11],
       [12, 13, 14, 15]])
>>> labels = np.zeros_like(a)
>>> labels[:2,:2] = 1
>>> labels[2:, 1:3] = 2
>>> labels
array([[1, 1, 0, 0],
       [1, 1, 0, 0],
       [0, 2, 2, 0],
       [0, 2, 2, 0]])
>>> from scipy import ndimage
>>> ndimage.maximum(a)
15
>>> ndimage.maximum(a, labels=labels, index=[1,2])
[5, 14]
>>> ndimage.maximum(a, labels=labels)
14

>>> b = np.array([[1, 2, 0, 0],
...               [5, 3, 0, 4],
...               [0, 0, 0, 7],
...               [9, 3, 0, 0]])
>>> labels, labels_nb = ndimage.label(b)
>>> labels
array([[1, 1, 0, 0],
       [1, 1, 0, 2],
       [0, 0, 0, 2],
       [3, 3, 0, 0]], dtype=int32)
>>> ndimage.maximum(b, labels=labels, index=np.arange(1, labels_nb + 1))
[5, 7, 9]

T)r   r   r   r   s      r>   r   r   J  s    Z 5%$7::rA   c                     [        XUSS9S   $ )a  
Calculate the median of the values of an array over labeled regions.

Parameters
----------
input : array_like
    Array_like of values. For each region specified by `labels`, the
    median value of `input` over the region is computed.
labels : array_like, optional
    An array_like of integers marking different regions over which the
    median value of `input` is to be computed. `labels` must have the
    same shape as `input`. If `labels` is not specified, the median
    over the whole array is returned.
index : array_like, optional
    A list of region labels that are taken into account for computing the
    medians. If index is None, the median over all elements where `labels`
    is non-zero is returned.

Returns
-------
median : float or list of floats
    List of medians of `input` over the regions determined by `labels` and
    whose index is in `index`. If `index` or `labels` are not specified, a
    float is returned: the median value of `input` if `labels` is None,
    and the median value of elements where `labels` is greater than zero
    if `index` is None.

See Also
--------
label, minimum, maximum, extrema, sum, mean, variance, standard_deviation

Notes
-----
The function returns a Python list and not a NumPy array, use
`np.array` to convert the list to an array.

Examples
--------
>>> from scipy import ndimage
>>> import numpy as np
>>> a = np.array([[1, 2, 0, 1],
...               [5, 3, 0, 4],
...               [0, 0, 0, 7],
...               [9, 3, 0, 0]])
>>> labels, labels_nb = ndimage.label(a)
>>> labels
array([[1, 1, 0, 2],
       [1, 1, 0, 2],
       [0, 0, 0, 2],
       [3, 3, 0, 0]], dtype=int32)
>>> ndimage.median(a, labels=labels, index=np.arange(1, labels_nb + 1))
[2.5, 4.0, 6.0]
>>> ndimage.median(a)
1.0
>>> ndimage.median(a, labels=labels)
3.0

T)r   r   r   r   s      r>   r   r     s    v 5%T:1==rA   c           	         [         R                  " [         R                  " U 5      R                  5      n[         R                  " S/[        USSS2   5      -   5      SSS2   n[        XUSS9S   n[         R                  " U5      (       a  [        XT-  U-  5      $ UR                  SS5      U-  U-   Vs/ s H  n[        U5      PM     sn$ s  snf )a  
Find the positions of the minimums of the values of an array at labels.

Parameters
----------
input : array_like
    Array_like of values.
labels : array_like, optional
    An array of integers marking different regions over which the
    position of the minimum value of `input` is to be computed.
    `labels` must have the same shape as `input`. If `labels` is not
    specified, the location of the first minimum over the whole
    array is returned.

    The `labels` argument only works when `index` is specified.
index : array_like, optional
    A list of region labels that are taken into account for finding the
    location of the minima. If `index` is None, the ``first`` minimum
    over all elements where `labels` is non-zero is returned.

    The `index` argument only works when `labels` is specified.

Returns
-------
output : list of tuples of ints
    Tuple of ints or list of tuples of ints that specify the location
    of minima of `input` over the regions determined by `labels` and
    whose index is in `index`.

    If `index` or `labels` are not specified, a tuple of ints is
    returned specifying the location of the first minimal value of `input`.

See Also
--------
label, minimum, median, maximum_position, extrema, sum, mean, variance,
standard_deviation

Examples
--------
>>> import numpy as np
>>> a = np.array([[10, 20, 30],
...               [40, 80, 100],
...               [1, 100, 200]])
>>> b = np.array([[1, 2, 0, 1],
...               [5, 3, 0, 4],
...               [0, 0, 0, 7],
...               [9, 3, 0, 0]])

>>> from scipy import ndimage

>>> ndimage.minimum_position(a)
(2, 0)
>>> ndimage.minimum_position(b)
(0, 2)

Features to process can be specified using `labels` and `index`:

>>> label, pos = ndimage.label(a)
>>> ndimage.minimum_position(a, label, index=np.arange(1, pos+1))
[(2, 0)]

>>> label, pos = ndimage.label(b)
>>> ndimage.minimum_position(b, label, index=np.arange(1, pos+1))
[(0, 0), (0, 3), (3, 1)]

r   Nr   r   T)r   
r!   arrayr"   r)   cumprodlistr   r_   tuplera   r4   r[   ri   dimsdim_prodr   vs          r>   r   r     s    F 88BJJu%++,Dzz1#T%1R%[ 1124R48HUEdCAFF	{{6f(D011%~~b!4@DHIHE!HHIII   7Cc           	         [         R                  " [         R                  " U 5      R                  5      n[         R                  " S/[        USSS2   5      -   5      SSS2   n[        XUSS9S   n[         R                  " U5      (       a  [        XT-  U-  5      $ UR                  SS5      U-  U-   Vs/ s H  n[        U5      PM     sn$ s  snf )a;  
Find the positions of the maximums of the values of an array at labels.

For each region specified by `labels`, the position of the maximum
value of `input` within the region is returned.

Parameters
----------
input : array_like
    Array_like of values.
labels : array_like, optional
    An array of integers marking different regions over which the
    position of the maximum value of `input` is to be computed.
    `labels` must have the same shape as `input`. If `labels` is not
    specified, the location of the first maximum over the whole
    array is returned.

    The `labels` argument only works when `index` is specified.
index : array_like, optional
    A list of region labels that are taken into account for finding the
    location of the maxima. If `index` is None, the first maximum
    over all elements where `labels` is non-zero is returned.

    The `index` argument only works when `labels` is specified.

Returns
-------
output : list of tuples of ints
    List of tuples of ints that specify the location of maxima of
    `input` over the regions determined by `labels` and whose index
    is in `index`.

    If `index` or `labels` are not specified, a tuple of ints is
    returned specifying the location of the ``first`` maximal value
    of `input`.

See Also
--------
label, minimum, median, maximum_position, extrema, sum, mean, variance,
standard_deviation

Examples
--------
>>> from scipy import ndimage
>>> import numpy as np
>>> a = np.array([[1, 2, 0, 0],
...               [5, 3, 0, 4],
...               [0, 0, 0, 7],
...               [9, 3, 0, 0]])
>>> ndimage.maximum_position(a)
(3, 0)

Features to process can be specified using `labels` and `index`:

>>> lbl = np.array([[0, 1, 2, 3],
...                 [0, 1, 2, 3],
...                 [0, 1, 2, 3],
...                 [0, 1, 2, 3]])
>>> ndimage.maximum_position(a, lbl, 1)
(1, 1)

If no index is given, non-zero `labels` are processed:

>>> ndimage.maximum_position(a, lbl)
(2, 3)

If there are no maxima, the position of the first element is returned:

>>> ndimage.maximum_position(a, lbl, 2)
(0, 2)

r   Nr   r   T)r   r   r   s          r>   r   r   '  s    R 88BJJu%++,Dzz1#T%1R%[ 1124R48HUEdCAFF	{{6f(D011%~~b!4@DHIHE!HHIIIr   c           
      B   [         R                  " [         R                  " U 5      R                  5      n[         R                  " S/[        USSS2   5      -   5      SSS2   n[        XUSSSSS9u  pVpx[         R                  " U5      (       a!  XW[        Xd-  U-  5      [        X-  U-  5      4$ UR                  SS5      U-  U-   V	s/ s H  n	[        U	5      PM     nn	UR                  SS5      U-  U-   V	s/ s H  n	[        U	5      PM     nn	XWXh4$ s  sn	f s  sn	f )aS  
Calculate the minimums and maximums of the values of an array
at labels, along with their positions.

Parameters
----------
input : ndarray
    N-D image data to process.
labels : ndarray, optional
    Labels of features in input.
    If not None, must be same shape as `input`.
index : int or sequence of ints, optional
    Labels to include in output.  If None (default), all values where
    non-zero `labels` are used.

Returns
-------
minimums, maximums : int or ndarray
    Values of minimums and maximums in each feature.
min_positions, max_positions : tuple or list of tuples
    Each tuple gives the N-D coordinates of the corresponding minimum
    or maximum.

See Also
--------
maximum, minimum, maximum_position, minimum_position, center_of_mass

Examples
--------
>>> import numpy as np
>>> a = np.array([[1, 2, 0, 0],
...               [5, 3, 0, 4],
...               [0, 0, 0, 7],
...               [9, 3, 0, 0]])
>>> from scipy import ndimage
>>> ndimage.extrema(a)
(0, 9, (0, 2), (3, 0))

Features to process can be specified using `labels` and `index`:

>>> lbl, nlbl = ndimage.label(a)
>>> ndimage.extrema(a, lbl, index=np.arange(1, nlbl+1))
(array([1, 4, 3]),
 array([5, 7, 9]),
 [(0, 0), (1, 3), (3, 1)],
 [(1, 0), (2, 3), (3, 0)])

If no index is given, non-zero `labels` are processed:

>>> ndimage.extrema(a, lbl)
(1, 9, (0, 0), (3, 0))

r   Nr   r   T)r   r   r   r   r   )
r4   r[   ri   r   r   minimumsmin_positionsmaximumsmax_positionsr   s
             r>   r   r   |  s8   l 88BJJu%++,Dzz1#T%1R%[ 1124R48H7>u?DHLHLRVRV8X4HX 
{{8E=+D*L$M}0D89; 	; )00Q78CtKKQaK   )00Q78CtKKQaK   };;s   D<Dc           	      .   [         R                  " U 5      n [        XU5      n[         R                  U R                   Vs/ s H  n[        SU5      PM     sn   n[        U R                  5       Vs/ s H*  n[        XU   R                  [        5      -  X5      U-  PM,     nn[         R                  " US   5      (       a  [        U5      $ [         R                  " U5      R                   Vs/ s H  n[        U5      PM     sn$ s  snf s  snf s  snf )a  
Calculate the center of mass of the values of an array at labels.

Parameters
----------
input : ndarray
    Data from which to calculate center-of-mass. The masses can either
    be positive or negative.
labels : ndarray, optional
    Labels for objects in `input`, as generated by `ndimage.label`.
    Only used with `index`. Dimensions must be the same as `input`.
index : int or sequence of ints, optional
    Labels for which to calculate centers-of-mass. If not specified,
    the combined center of mass of all labels greater than zero
    will be calculated. Only used with `labels`.

Returns
-------
center_of_mass : tuple, or list of tuples
    Coordinates of centers-of-mass.

Examples
--------
>>> import numpy as np
>>> a = np.array(([0,0,0,0],
...               [0,1,1,0],
...               [0,1,1,0],
...               [0,1,1,0]))
>>> from scipy import ndimage
>>> ndimage.center_of_mass(a)
(2.0, 1.5)

Calculation of multiple objects in an image

>>> b = np.array(([0,1,1,0],
...               [0,1,0,0],
...               [0,0,0,0],
...               [0,0,1,1],
...               [0,0,1,1]))
>>> lbl = ndimage.label(b)[0]
>>> ndimage.center_of_mass(b, lbl, [1,2])
[(0.33333333333333331, 1.3333333333333333), (3.5, 2.5)]

Negative masses are also accepted, which can occur for example when
bias is removed from measured data due to random noise.

>>> c = np.array(([-1,0,0,0],
...               [0,-1,-1,0],
...               [0,1,-1,0],
...               [0,1,1,0]))
>>> ndimage.center_of_mass(c)
(-4.0, 1.0)

If there are division by zero issues, the function does not raise an
error but rather issues a RuntimeWarning before returning inf and/or NaN.

>>> d = np.array([-1, 1])
>>> ndimage.center_of_mass(d)
(inf,)
r   )r!   r"   r   ogridr)   slicerQ   r&   rf   r   r_   r   r   T)	r4   r[   ri   
normalizerrV   gridsdirresultsr   s	            r>   r   r     s    z JJuEE51JHH5;;7;aeAqk;78E  

+-+3 %*"3"3E"::FJZW+  - 
{{71:W~ hhw/1121E!H122 8- 3s    D21D0Dc           
      f   ^ [         R                  " XUS-   5      mU4S jn[        XXV[        SSS9$ )a  
Calculate the histogram of the values of an array, optionally at labels.

Histogram calculates the frequency of values in an array within bins
determined by `min`, `max`, and `bins`. The `labels` and `index`
keywords can limit the scope of the histogram to specified sub-regions
within the array.

Parameters
----------
input : array_like
    Data for which to calculate histogram.
min, max : int
    Minimum and maximum values of range of histogram bins.
bins : int
    Number of bins.
labels : array_like, optional
    Labels for objects in `input`.
    If not None, must be same shape as `input`.
index : int or sequence of ints, optional
    Label or labels for which to calculate histogram. If None, all values
    where label is greater than zero are used

Returns
-------
hist : ndarray
    Histogram counts.

Examples
--------
>>> import numpy as np
>>> a = np.array([[ 0.    ,  0.2146,  0.5962,  0.    ],
...               [ 0.    ,  0.7778,  0.    ,  0.    ],
...               [ 0.    ,  0.    ,  0.    ,  0.    ],
...               [ 0.    ,  0.    ,  0.7181,  0.2787],
...               [ 0.    ,  0.    ,  0.6573,  0.3094]])
>>> from scipy import ndimage
>>> ndimage.histogram(a, 0, 1, 10)
array([13,  0,  2,  1,  0,  1,  1,  2,  0,  0])

With labels and no indices, non-zero elements are counted:

>>> lbl, nlbl = ndimage.label(a)
>>> ndimage.histogram(a, 0, 1, 10, lbl)
array([0, 0, 2, 1, 0, 1, 1, 2, 0, 0])

Indices can be used to count only certain objects:

>>> ndimage.histogram(a, 0, 1, 10, lbl, 2)
array([0, 0, 1, 1, 0, 0, 1, 1, 0, 0])

r   c                 8   > [         R                  " U T5      S   $ r   )r!   r   )r   _binss    r>   _histhistogram.<locals>._histL  s    ||D%(++rA   NF)rl   )r!   linspacer
   object)r4   rg   r@   binsr[   ri   r   r   s          @r>   r   r     s9    j KK$(+E, !fd057 7rA   c                    [         R                  " U 5      n U R                  R                  [         R                  [         R
                  4;  a  [        S5      eUc!  [        R                  " U R                  S5      n[         R                  " U[        S9nUR                  U R                  :w  a  [        S5      eUR                   H  nUS:w  d  M  [        S5      e   UR                  R                  (       d  UR                  5       n[         R                  " U5      nU R                  UR                  :w  a  [        S5      e[         R                   [         R"                  [         R$                  [         R&                  [         R(                  [         R*                  /nUR                  R                  U;  a  [        S5      e[-        U[         R.                  5      (       a&  UR                  R                  U;  a  [        S	5      eOUR                  n[0        R2                  " X05      n[4        R6                  " XX#5        U$ )
a  
Apply watershed from markers using image foresting transform algorithm.

Parameters
----------
input : array_like
    Input.
markers : array_like
    Markers are points within each watershed that form the beginning
    of the process. Negative markers are considered background markers
    which are processed after the other markers.
structure : structure element, optional
    A structuring element defining the connectivity of the object can be
    provided. If None, an element is generated with a squared
    connectivity equal to one.
output : ndarray, optional
    An output array can optionally be provided. The same shape as input.

Returns
-------
watershed_ift : ndarray
    Output.  Same shape as `input`.

References
----------
.. [1] A.X. Falcao, J. Stolfi and R. de Alencar Lotufo, "The image
       foresting transform: theory, algorithms, and applications",
       Pattern Analysis and Machine Intelligence, vol. 26, pp. 19-29, 2004.

z+only 8 and 16 unsigned inputs are supportedr   r   r   r   r    z'input and markers must have equal shapez marker should be of integer typez output should be of integer type)r!   r"   r   rE   uint8uint16r$   r   r%   r&   r'   r(   r)   flags
contiguousr   int8int16r0   int64intcr/   r,   r-   r   _get_outputr   r   )r4   markersr5   r6   r7   integral_typess         r>   r   r   S  s   > JJuE{{"))44EFF99%**aH	

9D1I~~#EFFoo7HII  ??%%NN$	jj!G{{gmm#DEEgghhhhhhggggN }}/=>>&"**%%<<N2ABB 3 $$V3FEI>MrA   )NN)r   )F)NNF)NNFFFFF)numpyr!    r   r   r   r   __all__r   r	   r   r
   r|   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r    rA   r>   <module>r      s   >     H@!FF4R (, ph */Zzj&Z,*Z29j29j13h FK9>sl<;~M;`;>|LJ^RJjL<^G3T;7|DrA   