Package net.imglib2.kdtree
Class KDTreePositions.Nested
- java.lang.Object
-
- net.imglib2.kdtree.KDTreePositions
-
- net.imglib2.kdtree.KDTreePositions.Nested
-
- Enclosing class:
- KDTreePositions
private static class KDTreePositions.Nested extends KDTreePositions
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.imglib2.kdtree.KDTreePositions
KDTreePositions.PositionsLayout
-
-
Field Summary
Fields Modifier and Type Field Description private double[][]positions-
Fields inherited from class net.imglib2.kdtree.KDTreePositions
numDimensions, numPoints
-
-
Constructor Summary
Constructors Constructor Description Nested(double[][] positions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]asFlatArray()Get positions of points in the tree as a flatdouble[]array wherepositions[d + i*n]is dimensiondof thei-th point.double[][]asNestedArray()Get positions of points in the tree as a nesteddouble[][]array wherepositions[d][i]is dimensiondof thei-th point.protected RealIntervalcreateBoundingBox()doubleget(int i, int d)Get the coordinates of the nodeiin dimensiond.KDTreePositions.PositionsLayoutlayout()Get the internal layout of positions.-
Methods inherited from class net.imglib2.kdtree.KDTreePositions
createFlat, createNested, numDimensions, numPoints
-
-
-
-
Method Detail
-
get
public double get(int i, int d)Description copied from class:KDTreePositionsGet the coordinates of the nodeiin dimensiond.- Specified by:
getin classKDTreePositions- Returns:
- the coordinate
-
asFlatArray
public double[] asFlatArray()
Description copied from class:KDTreePositionsGet positions of points in the tree as a flatdouble[]array wherepositions[d + i*n]is dimensiondof thei-th point.For serialisation and usage by the tree.
Internal storage may be a
NESTEDdouble[][]array. In this case,flatPositions()returnsnull.- Specified by:
asFlatArrayin classKDTreePositions
-
asNestedArray
public double[][] asNestedArray()
Description copied from class:KDTreePositionsGet positions of points in the tree as a nesteddouble[][]array wherepositions[d][i]is dimensiondof thei-th point.For serialisation and usage by the tree.
Internal storage may be flattened into single
double[]array. In this case, the nesteddouble[][]array is created here.- Specified by:
asNestedArrayin classKDTreePositions
-
createBoundingBox
protected RealInterval createBoundingBox()
- Specified by:
createBoundingBoxin classKDTreePositions
-
layout
public KDTreePositions.PositionsLayout layout()
Description copied from class:KDTreePositionsGet the internal layout of positions.Positions are stored in either
FLATorNESTEDlayout. WithNESTEDlayout, positions are stored as a nesteddouble[][]array wherepositions[d][i]is dimensiondof thei-th point. WithFLATlayout, positions are stored as a flatdouble[]array, wherepositions[d + i*n]is dimensiondof thei-th point, withnthe number of dimensions.- Specified by:
layoutin classKDTreePositions
-
-