Class AbstractRealLocalizable
java.lang.Object
net.imglib2.AbstractEuclideanSpace
net.imglib2.AbstractRealLocalizable
- All Implemented Interfaces:
EuclideanSpace, RealLocalizable
- Direct Known Subclasses:
RealPoint, RealPointSample
public abstract class AbstractRealLocalizable
extends AbstractEuclideanSpace
implements RealLocalizable
An abstract class that implements the
RealLocalizable interface using
an array of doubles to maintain position-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final double[]TheRealLocalizableinterface is implemented using the position stored here.Fields inherited from class AbstractEuclideanSpace
n -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractRealLocalizable(double[] position) Protected constructor that re-uses the passed position array.protectedAbstractRealLocalizable(int n) -
Method Summary
Modifier and TypeMethodDescriptiondoublegetDoublePosition(int d) Return the current position in a given dimension.floatgetFloatPosition(int d) Return the current position in a given dimension.voidlocalize(double[] pos) Write the current position into the passed array.voidlocalize(float[] pos) Write the current position into the passed array.Methods inherited from class AbstractEuclideanSpace
numDimensionsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface EuclideanSpace
numDimensionsMethods inherited from interface RealLocalizable
localize, positionAsDoubleArray, positionAsRealPoint
-
Field Details
-
position
protected final double[] positionTheRealLocalizableinterface is implemented using the position stored here.RealPositionablesubclasses, such asRealPoint, modify this array.
-
-
Constructor Details
-
AbstractRealLocalizable
protected AbstractRealLocalizable(int n) - Parameters:
n- number of dimensions.
-
AbstractRealLocalizable
protected AbstractRealLocalizable(double[] position) Protected constructor that re-uses the passed position array. This is intended to allow subclasses to provide a way to wrap a double[] array.- Parameters:
position- position array to use.
-
-
Method Details
-
localize
public void localize(float[] pos) Description copied from interface:RealLocalizableWrite the current position into the passed array.- Specified by:
localizein interfaceRealLocalizable- Parameters:
pos- receives current position, length must be ≥EuclideanSpace.numDimensions()
-
localize
public void localize(double[] pos) Description copied from interface:RealLocalizableWrite the current position into the passed array.- Specified by:
localizein interfaceRealLocalizable- Parameters:
pos- receives current position, length must be ≥EuclideanSpace.numDimensions()
-
getFloatPosition
public float getFloatPosition(int d) Description copied from interface:RealLocalizableReturn the current position in a given dimension.- Specified by:
getFloatPositionin interfaceRealLocalizable- Parameters:
d- dimension- Returns:
- dimension of current position
-
getDoublePosition
public double getDoublePosition(int d) Description copied from interface:RealLocalizableReturn the current position in a given dimension.- Specified by:
getDoublePositionin interfaceRealLocalizable- Parameters:
d- dimension- Returns:
- dimension of current position
-