Package net.imglib2
Class AbstractRealLocalizable
java.lang.Object
net.imglib2.AbstractEuclideanSpace
net.imglib2.AbstractRealLocalizable
- All Implemented Interfaces:
EuclideanSpace,RealLocalizable
- Direct Known Subclasses:
RealPoint
public abstract class AbstractRealLocalizable
extends AbstractEuclideanSpace
implements RealLocalizable
An abstract class that implements the
RealLocalizable interface using
an array of doubles to maintain position- Author:
- Lee Kamentsky, Stephan Saalfeld, Tobias Pietzsch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final double[]TheRealLocalizableinterface is implemented using the position stored here.Fields inherited from class net.imglib2.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 net.imglib2.AbstractEuclideanSpace
numDimensionsMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
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
-
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
-
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
-