Package net.imglib2
Class AbstractLocalizable
- java.lang.Object
-
- net.imglib2.AbstractEuclideanSpace
-
- net.imglib2.AbstractLocalizable
-
- All Implemented Interfaces:
EuclideanSpace
,Localizable
,RealLocalizable
- Direct Known Subclasses:
AbstractLocalizingCursor
,AbstractLongListImg.LongListRandomAccess
,AbstractOutOfBoundsValue
,CellRandomAccess
,MixedRandomAccess
,OutOfBoundsBorder
,OutOfBoundsPeriodic
,Point
,SlicingRandomAccess
,TransformRandomAccess
public abstract class AbstractLocalizable extends AbstractEuclideanSpace implements Localizable
An abstract class that implements theLocalizable
interface using a long[] array to maintain position.- Author:
- Stephan Preibisch, Stephan Saalfeld, Tobias Pietzsch
-
-
Field Summary
Fields Modifier and Type Field Description protected long[]
position
TheLocalizable
interface is implemented using the position stored here.-
Fields inherited from class net.imglib2.AbstractEuclideanSpace
n
-
-
Constructor Summary
Constructors Modifier Constructor Description AbstractLocalizable(int n)
protected
AbstractLocalizable(long[] position)
Protected constructor that re-uses the passed position array.
-
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.int
getIntPosition(int d)
Return the current position in a given dimension.long
getLongPosition(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.void
localize(int[] pos)
Write the current position into the passed array.void
localize(long[] 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 long[] position
TheLocalizable
interface is implemented using the position stored here.Positionable
subclasses, such asPoint
, modify this array.
-
-
Constructor Detail
-
AbstractLocalizable
public AbstractLocalizable(int n)
- Parameters:
n
- number of dimensions.
-
AbstractLocalizable
protected AbstractLocalizable(long[] position)
Protected constructor that re-uses the passed position array. This is intended to allow subclasses to provide a way to wrap a long[] 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
-
localize
public void localize(int[] pos)
Description copied from interface:Localizable
Write the current position into the passed array.- Specified by:
localize
in interfaceLocalizable
- Parameters:
pos
- receives current position
-
localize
public void localize(long[] pos)
Description copied from interface:Localizable
Write the current position into the passed array.- Specified by:
localize
in interfaceLocalizable
- 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
-
getIntPosition
public int getIntPosition(int d)
Description copied from interface:Localizable
Return the current position in a given dimension.- Specified by:
getIntPosition
in interfaceLocalizable
- Parameters:
d
- dimension- Returns:
- dimension of current position
-
getLongPosition
public long getLongPosition(int d)
Description copied from interface:Localizable
Return the current position in a given dimension.- Specified by:
getLongPosition
in interfaceLocalizable
- Parameters:
d
- dimension- Returns:
- dimension of current position
-
-