# encoding: utf-8
# module dipy.tracking.fbcmeasures
# from C:\Users\xukai\Downloads\发票2\venv\Lib\site-packages\dipy\tracking\fbcmeasures.cp311-win_amd64.pyd
# by generator 1.147
# no doc

# imports
import builtins as __builtins__ # <module 'builtins' (built-in)>
import numpy as np # C:\Users\xukai\Downloads\发票2\venv\Lib\site-packages\numpy\__init__.py
from dipy.utils.omp import determine_num_threads

import scipy.interpolate._polyint as __scipy_interpolate__polyint
import scipy.spatial._ckdtree as __scipy_spatial__ckdtree


# functions

def compute_rfbc(*args, **kwargs): # real signature unknown
    """
    Compute the relative fiber to bundle coherence (RFBC)
    
        Parameters
        ----------
        streamlines_length : 1D int array
            Contains the length of each streamline
        streamlines_scores : 2D double array
            Contains the local fiber to bundle coherence (LFBC) for each streamline
            element.
        max_windowsize : int
            The maximal window size used to calculate the average LFBC region
    
        Returns
        -------
        output: normalized lowest average LFBC region along the fiber
    """
    pass

def min_moving_average(*args, **kwargs): # real signature unknown
    """
    Return the lowest cumulative sum for the score of a streamline segment
    
        Parameters
        ----------
        a : array
            Input array
    
        n : int
            Length of the segment
    
        Returns
        -------
        output: normalized lowest average LFBC region along the fiber
    """
    pass

def __pyx_unpickle_Enum(*args, **kwargs): # real signature unknown
    pass

def __pyx_unpickle_FBCMeasures(*args, **kwargs): # real signature unknown
    pass

# classes

class FBCMeasures(object):
    # no doc
    def get_points_rfbc_thresholded(self, *args, **kwargs): # real signature unknown
        """
        Set a threshold on the RFBC to remove spurious fibers.
        
                Parameters
                ----------
                threshold : float
                    The threshold to set on the RFBC, should be within 0 and 1.
                emphasis : float
                    Enhances the coloring of the fibers by LFBC. Increasing emphasis
                    will stress spurious fibers by logarithmic weighting.
                verbose : boolean
                    Prints info about the found RFBC for the set of fibers such as
                    median, mean, min and max values.
        
                Returns
                -------
                output : tuple with 3 elements
                    The output contains:
                    1) a collection of streamlines, each n by 3, with n
                    being the number of nodes in the fiber that remain after filtering
                    2) the r,g,b values of the local fiber to bundle coherence (LFBC)
                    3) the relative fiber to bundle coherence (RFBC)
        """
        pass

    def __init__(self, *args, **kwargs): # real signature unknown
        """
        Compute the fiber to bundle coherence measures for a set of
                streamlines.
        
                Parameters
                ----------
                streamlines : list
                    A collection of streamlines, each n by 3, with n being the number of
                    nodes in the fiber.
                kernel : Kernel object
                    A diffusion kernel object created from EnhancementKernel.
                min_fiberlength : int
                    Fibers with fewer points than minimum_length are excluded from FBC
                    computation.
                max_windowsize : int
                    The maximal window size used to calculate the average LFBC region
                num_threads : int, optional
                    Number of threads to be used for OpenMP parallelization. If None
                    (default) the value of OMP_NUM_THREADS environment variable is used
                    if it is set, otherwise all available threads are used. If < 0 the
                    maximal number of threads minus |num_threads + 1| is used (enter -1
                    to use as many threads as possible). 0 raises an error.
                verbose : boolean
                    Enable verbose mode.
        
                References
                ----------
                [Meesters2016_HBM] S. Meesters, G. Sanguinetti, E. Garyfallidis,
                                   J. Portegies, P. Ossenblok, R. Duits. (2016) Cleaning
                                   output of tractography via fiber to bundle coherence,
                                   a new open source implementation. Human Brain Mapping
                                   conference 2016.
                [Portegies2015b] J. Portegies, R. Fick, G. Sanguinetti, S. Meesters,
                                 G.Girard, and R. Duits. (2015) Improving Fiber Alignment
                                 in HARDI by Combining Contextual PDE flow with
                                 Constrained Spherical Deconvolution. PLoS One.
        """
        pass

    @staticmethod # known case of __new__
    def __new__(*args, **kwargs): # real signature unknown
        """ Create and return a new object.  See help(type) for accurate signature. """
        pass

    def __reduce__(self, *args, **kwargs): # real signature unknown
        pass

    def __setstate__(self, *args, **kwargs): # real signature unknown
        pass

    __pyx_vtable__ = None # (!) real value is '<capsule object NULL at 0x000002BA3B8EE490>'


class interp1d(__scipy_interpolate__polyint._Interpolator1D):
    """
    Interpolate a 1-D function.
    
        `x` and `y` are arrays of values used to approximate some function f:
        ``y = f(x)``. This class returns a function whose call method uses
        interpolation to find the value of new points.
    
        Parameters
        ----------
        x : (N,) array_like
            A 1-D array of real values.
        y : (...,N,...) array_like
            A N-D array of real values. The length of `y` along the interpolation
            axis must be equal to the length of `x`.
        kind : str or int, optional
            Specifies the kind of interpolation as a string or as an integer
            specifying the order of the spline interpolator to use.
            The string has to be one of 'linear', 'nearest', 'nearest-up', 'zero',
            'slinear', 'quadratic', 'cubic', 'previous', or 'next'. 'zero',
            'slinear', 'quadratic' and 'cubic' refer to a spline interpolation of
            zeroth, first, second or third order; 'previous' and 'next' simply
            return the previous or next value of the point; 'nearest-up' and
            'nearest' differ when interpolating half-integers (e.g. 0.5, 1.5)
            in that 'nearest-up' rounds up and 'nearest' rounds down. Default
            is 'linear'.
        axis : int, optional
            Specifies the axis of `y` along which to interpolate.
            Interpolation defaults to the last axis of `y`.
        copy : bool, optional
            If True, the class makes internal copies of x and y.
            If False, references to `x` and `y` are used. The default is to copy.
        bounds_error : bool, optional
            If True, a ValueError is raised any time interpolation is attempted on
            a value outside of the range of x (where extrapolation is
            necessary). If False, out of bounds values are assigned `fill_value`.
            By default, an error is raised unless ``fill_value="extrapolate"``.
        fill_value : array-like or (array-like, array_like) or "extrapolate", optional
            - if a ndarray (or float), this value will be used to fill in for
              requested points outside of the data range. If not provided, then
              the default is NaN. The array-like must broadcast properly to the
              dimensions of the non-interpolation axes.
            - If a two-element tuple, then the first element is used as a
              fill value for ``x_new < x[0]`` and the second element is used for
              ``x_new > x[-1]``. Anything that is not a 2-element tuple (e.g.,
              list or ndarray, regardless of shape) is taken to be a single
              array-like argument meant to be used for both bounds as
              ``below, above = fill_value, fill_value``. Using a two-element tuple
              or ndarray requires ``bounds_error=False``.
    
              .. versionadded:: 0.17.0
            - If "extrapolate", then points outside the data range will be
              extrapolated.
    
              .. versionadded:: 0.17.0
        assume_sorted : bool, optional
            If False, values of `x` can be in any order and they are sorted first.
            If True, `x` has to be an array of monotonically increasing values.
    
        Attributes
        ----------
        fill_value
    
        Methods
        -------
        __call__
    
        See Also
        --------
        splrep, splev
            Spline interpolation/smoothing based on FITPACK.
        UnivariateSpline : An object-oriented wrapper of the FITPACK routines.
        interp2d : 2-D interpolation
    
        Notes
        -----
        Calling `interp1d` with NaNs present in input values results in
        undefined behaviour.
    
        Input values `x` and `y` must be convertible to `float` values like
        `int` or `float`.
    
        If the values in `x` are not unique, the resulting behavior is
        undefined and specific to the choice of `kind`, i.e., changing
        `kind` will change the behavior for duplicates.
    
    
        Examples
        --------
        >>> import numpy as np
        >>> import matplotlib.pyplot as plt
        >>> from scipy import interpolate
        >>> x = np.arange(0, 10)
        >>> y = np.exp(-x/3.0)
        >>> f = interpolate.interp1d(x, y)
    
        >>> xnew = np.arange(0, 9, 0.1)
        >>> ynew = f(xnew)   # use interpolation function returned by `interp1d`
        >>> plt.plot(x, y, 'o', xnew, ynew, '-')
        >>> plt.show()
    """
    def _call_linear(self, x_new): # reliably restored by inspect
        # no doc
        pass

    def _call_linear_np(self, x_new): # reliably restored by inspect
        # no doc
        pass

    def _call_nan_spline(self, x_new): # reliably restored by inspect
        # no doc
        pass

    def _call_nearest(self, x_new): # reliably restored by inspect
        """ Find nearest neighbor interpolated y_new = f(x_new). """
        pass

    def _call_previousnext(self, x_new): # reliably restored by inspect
        """ Use previous/next neighbor of x_new, y_new = f(x_new). """
        pass

    def _call_spline(self, x_new): # reliably restored by inspect
        # no doc
        pass

    def _check_and_update_bounds_error_for_extrapolation(self): # reliably restored by inspect
        # no doc
        pass

    def _check_bounds(self, x_new): # reliably restored by inspect
        """
        Check the inputs for being in the bounds of the interpolated data.
        
                Parameters
                ----------
                x_new : array
        
                Returns
                -------
                out_of_bounds : bool array
                    The mask on x_new of values that are out of the bounds.
        """
        pass

    def _evaluate(self, x_new): # reliably restored by inspect
        # no doc
        pass

    def __init__(self, x, y, kind=None, axis=-1, copy=True, bounds_error=None, fill_value=nan, assume_sorted=False): # reliably restored by inspect
        """ Initialize a 1-D linear interpolation class. """
        pass

    fill_value = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
    """The fill value."""

    __weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
    """list of weak references to the object (if defined)"""


    __dict__ = None # (!) real value is 'mappingproxy({\'__module__\': \'scipy.interpolate._interpolate\', \'__doc__\': \'\\n    Interpolate a 1-D function.\\n\\n    `x` and `y` are arrays of values used to approximate some function f:\\n    ``y = f(x)``. This class returns a function whose call method uses\\n    interpolation to find the value of new points.\\n\\n    Parameters\\n    ----------\\n    x : (N,) array_like\\n        A 1-D array of real values.\\n    y : (...,N,...) array_like\\n        A N-D array of real values. The length of `y` along the interpolation\\n        axis must be equal to the length of `x`.\\n    kind : str or int, optional\\n        Specifies the kind of interpolation as a string or as an integer\\n        specifying the order of the spline interpolator to use.\\n        The string has to be one of \\\'linear\\\', \\\'nearest\\\', \\\'nearest-up\\\', \\\'zero\\\',\\n        \\\'slinear\\\', \\\'quadratic\\\', \\\'cubic\\\', \\\'previous\\\', or \\\'next\\\'. \\\'zero\\\',\\n        \\\'slinear\\\', \\\'quadratic\\\' and \\\'cubic\\\' refer to a spline interpolation of\\n        zeroth, first, second or third order; \\\'previous\\\' and \\\'next\\\' simply\\n        return the previous or next value of the point; \\\'nearest-up\\\' and\\n        \\\'nearest\\\' differ when interpolating half-integers (e.g. 0.5, 1.5)\\n        in that \\\'nearest-up\\\' rounds up and \\\'nearest\\\' rounds down. Default\\n        is \\\'linear\\\'.\\n    axis : int, optional\\n        Specifies the axis of `y` along which to interpolate.\\n        Interpolation defaults to the last axis of `y`.\\n    copy : bool, optional\\n        If True, the class makes internal copies of x and y.\\n        If False, references to `x` and `y` are used. The default is to copy.\\n    bounds_error : bool, optional\\n        If True, a ValueError is raised any time interpolation is attempted on\\n        a value outside of the range of x (where extrapolation is\\n        necessary). If False, out of bounds values are assigned `fill_value`.\\n        By default, an error is raised unless ``fill_value="extrapolate"``.\\n    fill_value : array-like or (array-like, array_like) or "extrapolate", optional\\n        - if a ndarray (or float), this value will be used to fill in for\\n          requested points outside of the data range. If not provided, then\\n          the default is NaN. The array-like must broadcast properly to the\\n          dimensions of the non-interpolation axes.\\n        - If a two-element tuple, then the first element is used as a\\n          fill value for ``x_new < x[0]`` and the second element is used for\\n          ``x_new > x[-1]``. Anything that is not a 2-element tuple (e.g.,\\n          list or ndarray, regardless of shape) is taken to be a single\\n          array-like argument meant to be used for both bounds as\\n          ``below, above = fill_value, fill_value``. Using a two-element tuple\\n          or ndarray requires ``bounds_error=False``.\\n\\n          .. versionadded:: 0.17.0\\n        - If "extrapolate", then points outside the data range will be\\n          extrapolated.\\n\\n          .. versionadded:: 0.17.0\\n    assume_sorted : bool, optional\\n        If False, values of `x` can be in any order and they are sorted first.\\n        If True, `x` has to be an array of monotonically increasing values.\\n\\n    Attributes\\n    ----------\\n    fill_value\\n\\n    Methods\\n    -------\\n    __call__\\n\\n    See Also\\n    --------\\n    splrep, splev\\n        Spline interpolation/smoothing based on FITPACK.\\n    UnivariateSpline : An object-oriented wrapper of the FITPACK routines.\\n    interp2d : 2-D interpolation\\n\\n    Notes\\n    -----\\n    Calling `interp1d` with NaNs present in input values results in\\n    undefined behaviour.\\n\\n    Input values `x` and `y` must be convertible to `float` values like\\n    `int` or `float`.\\n\\n    If the values in `x` are not unique, the resulting behavior is\\n    undefined and specific to the choice of `kind`, i.e., changing\\n    `kind` will change the behavior for duplicates.\\n\\n\\n    Examples\\n    --------\\n    >>> import numpy as np\\n    >>> import matplotlib.pyplot as plt\\n    >>> from scipy import interpolate\\n    >>> x = np.arange(0, 10)\\n    >>> y = np.exp(-x/3.0)\\n    >>> f = interpolate.interp1d(x, y)\\n\\n    >>> xnew = np.arange(0, 9, 0.1)\\n    >>> ynew = f(xnew)   # use interpolation function returned by `interp1d`\\n    >>> plt.plot(x, y, \\\'o\\\', xnew, ynew, \\\'-\\\')\\n    >>> plt.show()\\n    \', \'__init__\': <function interp1d.__init__ at 0x000002BA59F5F420>, \'fill_value\': <property object at 0x000002BA59F70DB0>, \'_check_and_update_bounds_error_for_extrapolation\': <function interp1d._check_and_update_bounds_error_for_extrapolation at 0x000002BA59F5F600>, \'_call_linear_np\': <function interp1d._call_linear_np at 0x000002BA59F5F6A0>, \'_call_linear\': <function interp1d._call_linear at 0x000002BA59F5F740>, \'_call_nearest\': <function interp1d._call_nearest at 0x000002BA59F5F7E0>, \'_call_previousnext\': <function interp1d._call_previousnext at 0x000002BA59F5F880>, \'_call_spline\': <function interp1d._call_spline at 0x000002BA59F5F920>, \'_call_nan_spline\': <function interp1d._call_nan_spline at 0x000002BA59F5F9C0>, \'_evaluate\': <function interp1d._evaluate at 0x000002BA59F5FA60>, \'_check_bounds\': <function interp1d._check_bounds at 0x000002BA59F5FB00>, \'__dict__\': <attribute \'__dict__\' of \'interp1d\' objects>, \'__weakref__\': <attribute \'__weakref__\' of \'interp1d\' objects>})'


class KDTree(__scipy_spatial__ckdtree.cKDTree):
    """
    kd-tree for quick nearest-neighbor lookup.
    
        This class provides an index into a set of k-dimensional points
        which can be used to rapidly look up the nearest neighbors of any
        point.
    
        Parameters
        ----------
        data : array_like, shape (n,m)
            The n data points of dimension m to be indexed. This array is
            not copied unless this is necessary to produce a contiguous
            array of doubles, and so modifying this data will result in
            bogus results. The data are also copied if the kd-tree is built
            with copy_data=True.
        leafsize : positive int, optional
            The number of points at which the algorithm switches over to
            brute-force.  Default: 10.
        compact_nodes : bool, optional
            If True, the kd-tree is built to shrink the hyperrectangles to
            the actual data range. This usually gives a more compact tree that
            is robust against degenerated input data and gives faster queries
            at the expense of longer build time. Default: True.
        copy_data : bool, optional
            If True the data is always copied to protect the kd-tree against
            data corruption. Default: False.
        balanced_tree : bool, optional
            If True, the median is used to split the hyperrectangles instead of
            the midpoint. This usually gives a more compact tree and
            faster queries at the expense of longer build time. Default: True.
        boxsize : array_like or scalar, optional
            Apply a m-d toroidal topology to the KDTree.. The topology is generated
            by :math:`x_i + n_i L_i` where :math:`n_i` are integers and :math:`L_i`
            is the boxsize along i-th dimension. The input data shall be wrapped
            into :math:`[0, L_i)`. A ValueError is raised if any of the data is
            outside of this bound.
    
        Notes
        -----
        The algorithm used is described in Maneewongvatana and Mount 1999.
        The general idea is that the kd-tree is a binary tree, each of whose
        nodes represents an axis-aligned hyperrectangle. Each node specifies
        an axis and splits the set of points based on whether their coordinate
        along that axis is greater than or less than a particular value.
    
        During construction, the axis and splitting point are chosen by the
        "sliding midpoint" rule, which ensures that the cells do not all
        become long and thin.
    
        The tree can be queried for the r closest neighbors of any given point
        (optionally returning only those within some maximum distance of the
        point). It can also be queried, with a substantial gain in efficiency,
        for the r approximate closest neighbors.
    
        For large dimensions (20 is already large) do not expect this to run
        significantly faster than brute force. High-dimensional nearest-neighbor
        queries are a substantial open problem in computer science.
    
        Attributes
        ----------
        data : ndarray, shape (n,m)
            The n data points of dimension m to be indexed. This array is
            not copied unless this is necessary to produce a contiguous
            array of doubles. The data are also copied if the kd-tree is built
            with `copy_data=True`.
        leafsize : positive int
            The number of points at which the algorithm switches over to
            brute-force.
        m : int
            The dimension of a single data-point.
        n : int
            The number of data points.
        maxes : ndarray, shape (m,)
            The maximum value in each dimension of the n data points.
        mins : ndarray, shape (m,)
            The minimum value in each dimension of the n data points.
        size : int
            The number of nodes in the tree.
    """
    def count_neighbors(self, other, r, p=2.0, weights=None, cumulative=True): # reliably restored by inspect
        """
        Count how many nearby pairs can be formed.
        
                Count the number of pairs ``(x1,x2)`` can be formed, with ``x1`` drawn
                from ``self`` and ``x2`` drawn from ``other``, and where
                ``distance(x1, x2, p) <= r``.
        
                Data points on ``self`` and ``other`` are optionally weighted by the
                ``weights`` argument. (See below)
        
                This is adapted from the "two-point correlation" algorithm described by
                Gray and Moore [1]_.  See notes for further discussion.
        
                Parameters
                ----------
                other : KDTree
                    The other tree to draw points from, can be the same tree as self.
                r : float or one-dimensional array of floats
                    The radius to produce a count for. Multiple radii are searched with
                    a single tree traversal.
                    If the count is non-cumulative(``cumulative=False``), ``r`` defines
                    the edges of the bins, and must be non-decreasing.
                p : float, optional
                    1<=p<=infinity.
                    Which Minkowski p-norm to use.
                    Default 2.0.
                    A finite large p may cause a ValueError if overflow can occur.
                weights : tuple, array_like, or None, optional
                    If None, the pair-counting is unweighted.
                    If given as a tuple, weights[0] is the weights of points in
                    ``self``, and weights[1] is the weights of points in ``other``;
                    either can be None to indicate the points are unweighted.
                    If given as an array_like, weights is the weights of points in
                    ``self`` and ``other``. For this to make sense, ``self`` and
                    ``other`` must be the same tree. If ``self`` and ``other`` are two
                    different trees, a ``ValueError`` is raised.
                    Default: None
        
                    .. versionadded:: 1.6.0
                cumulative : bool, optional
                    Whether the returned counts are cumulative. When cumulative is set
                    to ``False`` the algorithm is optimized to work with a large number
                    of bins (>10) specified by ``r``. When ``cumulative`` is set to
                    True, the algorithm is optimized to work with a small number of
                    ``r``. Default: True
        
                    .. versionadded:: 1.6.0
        
                Returns
                -------
                result : scalar or 1-D array
                    The number of pairs. For unweighted counts, the result is integer.
                    For weighted counts, the result is float.
                    If cumulative is False, ``result[i]`` contains the counts with
                    ``(-inf if i == 0 else r[i-1]) < R <= r[i]``
        
                Notes
                -----
                Pair-counting is the basic operation used to calculate the two point
                correlation functions from a data set composed of position of objects.
        
                Two point correlation function measures the clustering of objects and
                is widely used in cosmology to quantify the large scale structure
                in our Universe, but it may be useful for data analysis in other fields
                where self-similar assembly of objects also occur.
        
                The Landy-Szalay estimator for the two point correlation function of
                ``D`` measures the clustering signal in ``D``. [2]_
        
                For example, given the position of two sets of objects,
        
                - objects ``D`` (data) contains the clustering signal, and
        
                - objects ``R`` (random) that contains no signal,
        
                .. math::
        
                     \xi(r) = \frac{<D, D> - 2 f <D, R> + f^2<R, R>}{f^2<R, R>},
        
                where the brackets represents counting pairs between two data sets
                in a finite bin around ``r`` (distance), corresponding to setting
                `cumulative=False`, and ``f = float(len(D)) / float(len(R))`` is the
                ratio between number of objects from data and random.
        
                The algorithm implemented here is loosely based on the dual-tree
                algorithm described in [1]_. We switch between two different
                pair-cumulation scheme depending on the setting of ``cumulative``.
                The computing time of the method we use when for
                ``cumulative == False`` does not scale with the total number of bins.
                The algorithm for ``cumulative == True`` scales linearly with the
                number of bins, though it is slightly faster when only
                1 or 2 bins are used. [5]_.
        
                As an extension to the naive pair-counting,
                weighted pair-counting counts the product of weights instead
                of number of pairs.
                Weighted pair-counting is used to estimate marked correlation functions
                ([3]_, section 2.2),
                or to properly calculate the average of data per distance bin
                (e.g. [4]_, section 2.1 on redshift).
        
                .. [1] Gray and Moore,
                       "N-body problems in statistical learning",
                       Mining the sky, 2000,
                       https://arxiv.org/abs/astro-ph/0012333
        
                .. [2] Landy and Szalay,
                       "Bias and variance of angular correlation functions",
                       The Astrophysical Journal, 1993,
                       http://adsabs.harvard.edu/abs/1993ApJ...412...64L
        
                .. [3] Sheth, Connolly and Skibba,
                       "Marked correlations in galaxy formation models",
                       Arxiv e-print, 2005,
                       https://arxiv.org/abs/astro-ph/0511773
        
                .. [4] Hawkins, et al.,
                       "The 2dF Galaxy Redshift Survey: correlation functions,
                       peculiar velocities and the matter density of the Universe",
                       Monthly Notices of the Royal Astronomical Society, 2002,
                       http://adsabs.harvard.edu/abs/2003MNRAS.346...78H
        
                .. [5] https://github.com/scipy/scipy/pull/5647#issuecomment-168474926
        
                Examples
                --------
                You can count neighbors number between two kd-trees within a distance:
        
                >>> import numpy as np
                >>> from scipy.spatial import KDTree
                >>> rng = np.random.default_rng()
                >>> points1 = rng.random((5, 2))
                >>> points2 = rng.random((5, 2))
                >>> kd_tree1 = KDTree(points1)
                >>> kd_tree2 = KDTree(points2)
                >>> kd_tree1.count_neighbors(kd_tree2, 0.2)
                1
        
                This number is same as the total pair number calculated by
                `query_ball_tree`:
        
                >>> indexes = kd_tree1.query_ball_tree(kd_tree2, r=0.2)
                >>> sum([len(i) for i in indexes])
                1
        """
        pass

    def query(self, x, k=1, eps=0, p=2, distance_upper_bound=inf, workers=1): # reliably restored by inspect
        """
        Query the kd-tree for nearest neighbors.
        
                Parameters
                ----------
                x : array_like, last dimension self.m
                    An array of points to query.
                k : int or Sequence[int], optional
                    Either the number of nearest neighbors to return, or a list of the
                    k-th nearest neighbors to return, starting from 1.
                eps : nonnegative float, optional
                    Return approximate nearest neighbors; the kth returned value
                    is guaranteed to be no further than (1+eps) times the
                    distance to the real kth nearest neighbor.
                p : float, 1<=p<=infinity, optional
                    Which Minkowski p-norm to use.
                    1 is the sum-of-absolute-values distance ("Manhattan" distance).
                    2 is the usual Euclidean distance.
                    infinity is the maximum-coordinate-difference distance.
                    A large, finite p may cause a ValueError if overflow can occur.
                distance_upper_bound : nonnegative float, optional
                    Return only neighbors within this distance. This is used to prune
                    tree searches, so if you are doing a series of nearest-neighbor
                    queries, it may help to supply the distance to the nearest neighbor
                    of the most recent point.
                workers : int, optional
                    Number of workers to use for parallel processing. If -1 is given
                    all CPU threads are used. Default: 1.
        
                    .. versionadded:: 1.6.0
        
                Returns
                -------
                d : float or array of floats
                    The distances to the nearest neighbors.
                    If ``x`` has shape ``tuple+(self.m,)``, then ``d`` has shape
                    ``tuple+(k,)``.
                    When k == 1, the last dimension of the output is squeezed.
                    Missing neighbors are indicated with infinite distances.
                    Hits are sorted by distance (nearest first).
        
                    .. versionchanged:: 1.9.0
                       Previously if ``k=None``, then `d` was an object array of
                       shape ``tuple``, containing lists of distances. This behavior
                       has been removed, use `query_ball_point` instead.
        
                i : integer or array of integers
                    The index of each neighbor in ``self.data``.
                    ``i`` is the same shape as d.
                    Missing neighbors are indicated with ``self.n``.
        
                Examples
                --------
        
                >>> import numpy as np
                >>> from scipy.spatial import KDTree
                >>> x, y = np.mgrid[0:5, 2:8]
                >>> tree = KDTree(np.c_[x.ravel(), y.ravel()])
        
                To query the nearest neighbours and return squeezed result, use
        
                >>> dd, ii = tree.query([[0, 0], [2.2, 2.9]], k=1)
                >>> print(dd, ii, sep='\n')
                [2.         0.2236068]
                [ 0 13]
        
                To query the nearest neighbours and return unsqueezed result, use
        
                >>> dd, ii = tree.query([[0, 0], [2.2, 2.9]], k=[1])
                >>> print(dd, ii, sep='\n')
                [[2.        ]
                 [0.2236068]]
                [[ 0]
                 [13]]
        
                To query the second nearest neighbours and return unsqueezed result,
                use
        
                >>> dd, ii = tree.query([[0, 0], [2.2, 2.9]], k=[2])
                >>> print(dd, ii, sep='\n')
                [[2.23606798]
                 [0.80622577]]
                [[ 6]
                 [19]]
        
                To query the first and second nearest neighbours, use
        
                >>> dd, ii = tree.query([[0, 0], [2.2, 2.9]], k=2)
                >>> print(dd, ii, sep='\n')
                [[2.         2.23606798]
                 [0.2236068  0.80622577]]
                [[ 0  6]
                 [13 19]]
        
                or, be more specific
        
                >>> dd, ii = tree.query([[0, 0], [2.2, 2.9]], k=[1, 2])
                >>> print(dd, ii, sep='\n')
                [[2.         2.23606798]
                 [0.2236068  0.80622577]]
                [[ 0  6]
                 [13 19]]
        """
        pass

    def query_ball_point(self, x, r, p=2.0, eps=0, workers=1, return_sorted=None, return_length=False): # reliably restored by inspect
        """
        Find all points within distance r of point(s) x.
        
                Parameters
                ----------
                x : array_like, shape tuple + (self.m,)
                    The point or points to search for neighbors of.
                r : array_like, float
                    The radius of points to return, must broadcast to the length of x.
                p : float, optional
                    Which Minkowski p-norm to use.  Should be in the range [1, inf].
                    A finite large p may cause a ValueError if overflow can occur.
                eps : nonnegative float, optional
                    Approximate search. Branches of the tree are not explored if their
                    nearest points are further than ``r / (1 + eps)``, and branches are
                    added in bulk if their furthest points are nearer than
                    ``r * (1 + eps)``.
                workers : int, optional
                    Number of jobs to schedule for parallel processing. If -1 is given
                    all processors are used. Default: 1.
        
                    .. versionadded:: 1.6.0
                return_sorted : bool, optional
                    Sorts returned indicies if True and does not sort them if False. If
                    None, does not sort single point queries, but does sort
                    multi-point queries which was the behavior before this option
                    was added.
        
                    .. versionadded:: 1.6.0
                return_length : bool, optional
                    Return the number of points inside the radius instead of a list
                    of the indices.
        
                    .. versionadded:: 1.6.0
        
                Returns
                -------
                results : list or array of lists
                    If `x` is a single point, returns a list of the indices of the
                    neighbors of `x`. If `x` is an array of points, returns an object
                    array of shape tuple containing lists of neighbors.
        
                Notes
                -----
                If you have many points whose neighbors you want to find, you may save
                substantial amounts of time by putting them in a KDTree and using
                query_ball_tree.
        
                Examples
                --------
                >>> import numpy as np
                >>> from scipy import spatial
                >>> x, y = np.mgrid[0:5, 0:5]
                >>> points = np.c_[x.ravel(), y.ravel()]
                >>> tree = spatial.KDTree(points)
                >>> sorted(tree.query_ball_point([2, 0], 1))
                [5, 10, 11, 15]
        
                Query multiple points and plot the results:
        
                >>> import matplotlib.pyplot as plt
                >>> points = np.asarray(points)
                >>> plt.plot(points[:,0], points[:,1], '.')
                >>> for results in tree.query_ball_point(([2, 0], [3, 3]), 1):
                ...     nearby_points = points[results]
                ...     plt.plot(nearby_points[:,0], nearby_points[:,1], 'o')
                >>> plt.margins(0.1, 0.1)
                >>> plt.show()
        """
        pass

    def query_ball_tree(self, other, r, p=2.0, eps=0): # reliably restored by inspect
        """
        Find all pairs of points between `self` and `other` whose distance is
                at most r.
        
                Parameters
                ----------
                other : KDTree instance
                    The tree containing points to search against.
                r : float
                    The maximum distance, has to be positive.
                p : float, optional
                    Which Minkowski norm to use.  `p` has to meet the condition
                    ``1 <= p <= infinity``.
                eps : float, optional
                    Approximate search.  Branches of the tree are not explored
                    if their nearest points are further than ``r/(1+eps)``, and
                    branches are added in bulk if their furthest points are nearer
                    than ``r * (1+eps)``.  `eps` has to be non-negative.
        
                Returns
                -------
                results : list of lists
                    For each element ``self.data[i]`` of this tree, ``results[i]`` is a
                    list of the indices of its neighbors in ``other.data``.
        
                Examples
                --------
                You can search all pairs of points between two kd-trees within a distance:
        
                >>> import matplotlib.pyplot as plt
                >>> import numpy as np
                >>> from scipy.spatial import KDTree
                >>> rng = np.random.default_rng()
                >>> points1 = rng.random((15, 2))
                >>> points2 = rng.random((15, 2))
                >>> plt.figure(figsize=(6, 6))
                >>> plt.plot(points1[:, 0], points1[:, 1], "xk", markersize=14)
                >>> plt.plot(points2[:, 0], points2[:, 1], "og", markersize=14)
                >>> kd_tree1 = KDTree(points1)
                >>> kd_tree2 = KDTree(points2)
                >>> indexes = kd_tree1.query_ball_tree(kd_tree2, r=0.2)
                >>> for i in range(len(indexes)):
                ...     for j in indexes[i]:
                ...         plt.plot([points1[i, 0], points2[j, 0]],
                ...             [points1[i, 1], points2[j, 1]], "-r")
                >>> plt.show()
        """
        pass

    def query_pairs(self, r, p=2.0, eps=0, output_type=None): # reliably restored by inspect
        """
        Find all pairs of points in `self` whose distance is at most r.
        
                Parameters
                ----------
                r : positive float
                    The maximum distance.
                p : float, optional
                    Which Minkowski norm to use.  `p` has to meet the condition
                    ``1 <= p <= infinity``.
                eps : float, optional
                    Approximate search.  Branches of the tree are not explored
                    if their nearest points are further than ``r/(1+eps)``, and
                    branches are added in bulk if their furthest points are nearer
                    than ``r * (1+eps)``.  `eps` has to be non-negative.
                output_type : string, optional
                    Choose the output container, 'set' or 'ndarray'. Default: 'set'
        
                    .. versionadded:: 1.6.0
        
                Returns
                -------
                results : set or ndarray
                    Set of pairs ``(i,j)``, with ``i < j``, for which the corresponding
                    positions are close. If output_type is 'ndarray', an ndarry is
                    returned instead of a set.
        
                Examples
                --------
                You can search all pairs of points in a kd-tree within a distance:
        
                >>> import matplotlib.pyplot as plt
                >>> import numpy as np
                >>> from scipy.spatial import KDTree
                >>> rng = np.random.default_rng()
                >>> points = rng.random((20, 2))
                >>> plt.figure(figsize=(6, 6))
                >>> plt.plot(points[:, 0], points[:, 1], "xk", markersize=14)
                >>> kd_tree = KDTree(points)
                >>> pairs = kd_tree.query_pairs(r=0.2)
                >>> for (i, j) in pairs:
                ...     plt.plot([points[i, 0], points[j, 0]],
                ...             [points[i, 1], points[j, 1]], "-r")
                >>> plt.show()
        """
        pass

    def sparse_distance_matrix(self, other, max_distance, p=2.0, output_type=None): # reliably restored by inspect
        """
        Compute a sparse distance matrix.
        
                Computes a distance matrix between two KDTrees, leaving as zero
                any distance greater than max_distance.
        
                Parameters
                ----------
                other : KDTree
        
                max_distance : positive float
        
                p : float, 1<=p<=infinity
                    Which Minkowski p-norm to use.
                    A finite large p may cause a ValueError if overflow can occur.
        
                output_type : string, optional
                    Which container to use for output data. Options: 'dok_matrix',
                    'coo_matrix', 'dict', or 'ndarray'. Default: 'dok_matrix'.
        
                    .. versionadded:: 1.6.0
        
                Returns
                -------
                result : dok_matrix, coo_matrix, dict or ndarray
                    Sparse matrix representing the results in "dictionary of keys"
                    format. If a dict is returned the keys are (i,j) tuples of indices.
                    If output_type is 'ndarray' a record array with fields 'i', 'j',
                    and 'v' is returned,
        
                Examples
                --------
                You can compute a sparse distance matrix between two kd-trees:
        
                >>> import numpy as np
                >>> from scipy.spatial import KDTree
                >>> rng = np.random.default_rng()
                >>> points1 = rng.random((5, 2))
                >>> points2 = rng.random((5, 2))
                >>> kd_tree1 = KDTree(points1)
                >>> kd_tree2 = KDTree(points2)
                >>> sdm = kd_tree1.sparse_distance_matrix(kd_tree2, 0.3)
                >>> sdm.toarray()
                array([[0.        , 0.        , 0.12295571, 0.        , 0.        ],
                   [0.        , 0.        , 0.        , 0.        , 0.        ],
                   [0.28942611, 0.        , 0.        , 0.2333084 , 0.        ],
                   [0.        , 0.        , 0.        , 0.        , 0.        ],
                   [0.24617575, 0.29571802, 0.26836782, 0.        , 0.        ]])
        
                You can check distances above the `max_distance` are zeros:
        
                >>> from scipy.spatial import distance_matrix
                >>> distance_matrix(points1, points2)
                array([[0.56906522, 0.39923701, 0.12295571, 0.8658745 , 0.79428925],
                   [0.37327919, 0.7225693 , 0.87665969, 0.32580855, 0.75679479],
                   [0.28942611, 0.30088013, 0.6395831 , 0.2333084 , 0.33630734],
                   [0.31994999, 0.72658602, 0.71124834, 0.55396483, 0.90785663],
                   [0.24617575, 0.29571802, 0.26836782, 0.57714465, 0.6473269 ]])
        """
        pass

    def __init__(self, data, leafsize=10, compact_nodes=True, copy_data=False, balanced_tree=True, boxsize=None): # reliably restored by inspect
        # no doc
        pass

    tree = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default

    __weakref__ = property(lambda self: object(), lambda self, v: None, lambda self: None)  # default
    """list of weak references to the object (if defined)"""


    innernode = None # (!) real value is "<class 'scipy.spatial._kdtree.KDTree.innernode'>"
    leafnode = None # (!) real value is "<class 'scipy.spatial._kdtree.KDTree.leafnode'>"
    node = None # (!) real value is "<class 'scipy.spatial._kdtree.KDTree.node'>"
    __dict__ = None # (!) real value is 'mappingproxy({\'__module__\': \'scipy.spatial._kdtree\', \'__doc__\': \'kd-tree for quick nearest-neighbor lookup.\\n\\n    This class provides an index into a set of k-dimensional points\\n    which can be used to rapidly look up the nearest neighbors of any\\n    point.\\n\\n    Parameters\\n    ----------\\n    data : array_like, shape (n,m)\\n        The n data points of dimension m to be indexed. This array is\\n        not copied unless this is necessary to produce a contiguous\\n        array of doubles, and so modifying this data will result in\\n        bogus results. The data are also copied if the kd-tree is built\\n        with copy_data=True.\\n    leafsize : positive int, optional\\n        The number of points at which the algorithm switches over to\\n        brute-force.  Default: 10.\\n    compact_nodes : bool, optional\\n        If True, the kd-tree is built to shrink the hyperrectangles to\\n        the actual data range. This usually gives a more compact tree that\\n        is robust against degenerated input data and gives faster queries\\n        at the expense of longer build time. Default: True.\\n    copy_data : bool, optional\\n        If True the data is always copied to protect the kd-tree against\\n        data corruption. Default: False.\\n    balanced_tree : bool, optional\\n        If True, the median is used to split the hyperrectangles instead of\\n        the midpoint. This usually gives a more compact tree and\\n        faster queries at the expense of longer build time. Default: True.\\n    boxsize : array_like or scalar, optional\\n        Apply a m-d toroidal topology to the KDTree.. The topology is generated\\n        by :math:`x_i + n_i L_i` where :math:`n_i` are integers and :math:`L_i`\\n        is the boxsize along i-th dimension. The input data shall be wrapped\\n        into :math:`[0, L_i)`. A ValueError is raised if any of the data is\\n        outside of this bound.\\n\\n    Notes\\n    -----\\n    The algorithm used is described in Maneewongvatana and Mount 1999.\\n    The general idea is that the kd-tree is a binary tree, each of whose\\n    nodes represents an axis-aligned hyperrectangle. Each node specifies\\n    an axis and splits the set of points based on whether their coordinate\\n    along that axis is greater than or less than a particular value.\\n\\n    During construction, the axis and splitting point are chosen by the\\n    "sliding midpoint" rule, which ensures that the cells do not all\\n    become long and thin.\\n\\n    The tree can be queried for the r closest neighbors of any given point\\n    (optionally returning only those within some maximum distance of the\\n    point). It can also be queried, with a substantial gain in efficiency,\\n    for the r approximate closest neighbors.\\n\\n    For large dimensions (20 is already large) do not expect this to run\\n    significantly faster than brute force. High-dimensional nearest-neighbor\\n    queries are a substantial open problem in computer science.\\n\\n    Attributes\\n    ----------\\n    data : ndarray, shape (n,m)\\n        The n data points of dimension m to be indexed. This array is\\n        not copied unless this is necessary to produce a contiguous\\n        array of doubles. The data are also copied if the kd-tree is built\\n        with `copy_data=True`.\\n    leafsize : positive int\\n        The number of points at which the algorithm switches over to\\n        brute-force.\\n    m : int\\n        The dimension of a single data-point.\\n    n : int\\n        The number of data points.\\n    maxes : ndarray, shape (m,)\\n        The maximum value in each dimension of the n data points.\\n    mins : ndarray, shape (m,)\\n        The minimum value in each dimension of the n data points.\\n    size : int\\n        The number of nodes in the tree.\\n\\n    \', \'node\': <class \'scipy.spatial._kdtree.KDTree.node\'>, \'leafnode\': <class \'scipy.spatial._kdtree.KDTree.leafnode\'>, \'innernode\': <class \'scipy.spatial._kdtree.KDTree.innernode\'>, \'tree\': <property object at 0x000002BA59C4CB80>, \'__init__\': <function KDTree.__init__ at 0x000002BA59C55BC0>, \'query\': <function KDTree.query at 0x000002BA59C55C60>, \'query_ball_point\': <function KDTree.query_ball_point at 0x000002BA59C55D00>, \'query_ball_tree\': <function KDTree.query_ball_tree at 0x000002BA59C55DA0>, \'query_pairs\': <function KDTree.query_pairs at 0x000002BA59C55E40>, \'count_neighbors\': <function KDTree.count_neighbors at 0x000002BA59C55EE0>, \'sparse_distance_matrix\': <function KDTree.sparse_distance_matrix at 0x000002BA59C55F80>, \'__dict__\': <attribute \'__dict__\' of \'KDTree\' objects>, \'__weakref__\': <attribute \'__weakref__\' of \'KDTree\' objects>})'


# variables with complex values

__loader__ = None # (!) real value is '<_frozen_importlib_external.ExtensionFileLoader object at 0x000002BA3B8D5950>'

__spec__ = None # (!) real value is "ModuleSpec(name='dipy.tracking.fbcmeasures', loader=<_frozen_importlib_external.ExtensionFileLoader object at 0x000002BA3B8D5950>, origin='C:\\\\Users\\\\xukai\\\\Downloads\\\\??2\\\\venv\\\\Lib\\\\site-packages\\\\dipy\\\\tracking\\\\fbcmeasures.cp311-win_amd64.pyd')"

__test__ = {}

