Package net.imglib2

Class KDTreeNode<T>

    • Field Detail

      • tree

        private final KDTree<T> tree
      • nodeIndex

        private int nodeIndex
      • values

        private java.util.function.IntFunction<T> values
    • Constructor Detail

      • KDTreeNode

        KDTreeNode​(KDTree<T> tree)
    • Method Detail

      • setNodeIndex

        public KDTreeNode<T> setNodeIndex​(int nodeIndex)
        Make this proxy refer to the given nodeIndex in the associated tree.
        Returns:
        this
      • nodeIndex

        public int nodeIndex()
        Get the nodeIndex which this proxy currently refers to.
      • left

        @Deprecated
        public KDTreeNode<T> left()
        Deprecated.
        KDTreeNode is now a re-usable proxy (like NativeType). To work with existing code, left(), right(), KDTree.getRoot() etc create new objects in each call, instead of re-using existing proxies. Code using that should be rewritten to reuse proxies, if possible.
        Left child of this node. All nodes x in the left subtree have x.pos[splitDimension] <= this.pos[splitDimension].
      • right

        @Deprecated
        public KDTreeNode<T> right()
        Deprecated.
        KDTreeNode is now a re-usable proxy (like NativeType). To work with existing code, left(), right(), KDTree.getRoot() etc create new objects in each call, instead of re-using existing proxies. Code using that should be rewritten to reuse proxies, if possible.
        Right child of this node. All nodes x in the right subtree have x.pos[splitDimension] >= this.pos[splitDimension].
      • getSplitDimension

        public final int getSplitDimension()
        Get the dimension along which this node divides the space.
        Returns:
        splitting dimension.
      • getSplitCoordinate

        public final double getSplitCoordinate()
        Get the position along getSplitDimension() where this node divides the space.
        Returns:
        splitting position.
      • getDoublePosition

        public double getDoublePosition​(int d)
        Description copied from interface: RealLocalizable
        Return the current position in a given dimension.
        Specified by:
        getDoublePosition in interface RealLocalizable
        Parameters:
        d - dimension
        Returns:
        dimension of current position
      • get

        public T get()
        Description copied from interface: Sampler
        Access the actual T instance providing access to a pixel, sub-pixel or integral region value the Sampler points at.
        Specified by:
        get in interface Sampler<T>
      • getType

        public T getType()
        Description copied from interface: Typed
        Get an instance of T.

        It should not be assumed that the returned T instance is an independent copy. In particular, repeated calls to getType() may return the same instance.

        Specified by:
        getType in interface Sampler<T>
        Specified by:
        getType in interface Typed<T>
        Returns:
        an instance of T
      • copy

        public KDTreeNode<T> copy()
        Specified by:
        copy in interface Sampler<T>
        Returns:
        - A new Sampler in the same state accessing the same values. It does NOT copy T, just the state of the Sampler. Otherwise use T.copy() if available. Sampler.copy().get() == Sampler.get(), i.e. both hold the same value, not necessarily the same instance (this is the case for an ArrayCursor for example)
      • squDistanceTo

        public final float squDistanceTo​(float[] p)
        Compute the squared distance from p to this node.
      • squDistanceTo

        public double squDistanceTo​(double[] p)
        Compute the squared distance from p to this node.
      • squDistanceTo

        public final double squDistanceTo​(RealLocalizable p)
        Compute the squared distance from p to this node.