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 theRealLocalizable
interface using an array of doubles to maintain position- Author:
- Lee Kamentsky, Stephan Saalfeld, Tobias Pietzsch
-
-
Field Summary
Fields Modifier and Type Field Description protected double[]
position
TheRealLocalizable
interface is implemented using the position stored here.-
Fields inherited from class net.imglib2.AbstractEuclideanSpace
n
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
AbstractRealLocalizable(double[] position)
Protected constructor that re-uses the passed position array.protected
AbstractRealLocalizable(int n)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getDoublePosition(int d)
Return the current position in a given dimension.float
getFloatPosition(int d)
Return the current position in a given dimension.void
localize(double[] pos)
Write the current position into the passed array.void
localize(float[] pos)
Write the current position into the passed array.-
Methods inherited from class net.imglib2.AbstractEuclideanSpace
numDimensions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
-
-
-
Field Detail
-
position
protected final double[] position
TheRealLocalizable
interface is implemented using the position stored here.RealPositionable
subclasses, such asRealPoint
, modify this array.
-
-
Constructor Detail
-
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 Detail
-
localize
public void localize(float[] pos)
Description copied from interface:RealLocalizable
Write the current position into the passed array.- Specified by:
localize
in interfaceRealLocalizable
- Parameters:
pos
- receives current position
-
localize
public void localize(double[] pos)
Description copied from interface:RealLocalizable
Write the current position into the passed array.- Specified by:
localize
in interfaceRealLocalizable
- Parameters:
pos
- receives current position
-
getFloatPosition
public float getFloatPosition(int d)
Description copied from interface:RealLocalizable
Return the current position in a given dimension.- Specified by:
getFloatPosition
in interfaceRealLocalizable
- Parameters:
d
- dimension- Returns:
- dimension of current position
-
getDoublePosition
public double getDoublePosition(int d)
Description copied from interface:RealLocalizable
Return the current position in a given dimension.- Specified by:
getDoublePosition
in interfaceRealLocalizable
- Parameters:
d
- dimension- Returns:
- dimension of current position
-
-