Class KDTreePositions.Flat
java.lang.Object
net.imglib2.kdtree.KDTreePositions
net.imglib2.kdtree.KDTreePositions.Flat
- Enclosing class:
KDTreePositions
-
Nested Class Summary
Nested classes/interfaces inherited from class KDTreePositions
KDTreePositions.PositionsLayout -
Field Summary
FieldsFields inherited from class KDTreePositions
numDimensions, numPoints -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble[]Get positions of points in the tree as a flatdouble[]array wherepositions[d + i*n]is dimensiondof thei-th point.double[][]Get positions of points in the tree as a nesteddouble[][]array wherepositions[d][i]is dimensiondof thei-th point.protected RealIntervaldoubleget(int i, int d) Get the coordinates of the nodeiin dimensiond.layout()Get the internal layout of positions.Methods inherited from class KDTreePositions
createFlat, createNested, numDimensions, numPoints
-
Field Details
-
positions
private final double[] positions
-
-
Constructor Details
-
Flat
Flat(double[] positions, int numDimensions)
-
-
Method Details
-
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
- Specified by:
createBoundingBoxin classKDTreePositions
-
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
-