Package net.imglib2.position.transform
Class AbstractPositionableTransform<LocalizablePositionable extends Localizable & Positionable>
- java.lang.Object
-
- net.imglib2.AbstractEuclideanSpace
-
- net.imglib2.position.transform.AbstractPositionableTransform<LocalizablePositionable>
-
- All Implemented Interfaces:
EuclideanSpace
,Positionable
,RealLocalizable
,RealPositionable
- Direct Known Subclasses:
Floor
,FloorOffset
,Round
public abstract class AbstractPositionableTransform<LocalizablePositionable extends Localizable & Positionable> extends AbstractEuclideanSpace implements RealPositionable, RealLocalizable
ARealPositionable
that drives aPositionable
to somehow derived discrete coordinates.- Author:
- Stephan Saalfeld
-
-
Field Summary
Fields Modifier and Type Field Description protected long[]
discrete
protected double[]
position
protected LocalizablePositionable
target
-
Fields inherited from class net.imglib2.AbstractEuclideanSpace
n
-
-
Constructor Summary
Constructors Constructor Description AbstractPositionableTransform(LocalizablePositionable target)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
bck(int dim)
Move by -1 in one dimension.void
fwd(int dim)
Move by 1 in one dimension.double
getDoublePosition(int dim)
Return the current position in a given dimension.float
getFloatPosition(int dim)
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
move(int[] distance)
Move the element relative to its current location using an int[] as distance vector.void
move(int distance, int dim)
Move the element in one dimension for some distance.void
move(long[] distance)
Move the element relative to its current location using a long[] as distance vector.void
move(long distance, int dim)
Move the element in one dimension for some distance.void
move(Localizable localizable)
Move the element relative to its current location using anLocalizable
as distance vector.void
setPosition(int[] position)
Set the position of the element.void
setPosition(int position, int d)
Set the position of the element for one dimension.void
setPosition(long[] position)
Set the position of the element.void
setPosition(long position, int d)
Set the position of the element for one dimension.void
setPosition(Localizable localizable)
Place the element at the same location as a givenLocalizable
java.lang.String
toString()
-
Methods inherited from class net.imglib2.AbstractEuclideanSpace
numDimensions
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
Methods inherited from interface net.imglib2.RealPositionable
move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPosition
-
-
-
-
Field Detail
-
target
protected final LocalizablePositionable extends Localizable & Positionable target
-
position
protected final double[] position
-
discrete
protected final long[] discrete
-
-
Constructor Detail
-
AbstractPositionableTransform
public AbstractPositionableTransform(LocalizablePositionable target)
-
-
Method Detail
-
getDoublePosition
public double getDoublePosition(int dim)
Description copied from interface:RealLocalizable
Return the current position in a given dimension.- Specified by:
getDoublePosition
in interfaceRealLocalizable
- Parameters:
dim
- dimension- Returns:
- dimension of current position
-
getFloatPosition
public float getFloatPosition(int dim)
Description copied from interface:RealLocalizable
Return the current position in a given dimension.- Specified by:
getFloatPosition
in interfaceRealLocalizable
- Parameters:
dim
- dimension- Returns:
- dimension of current position
-
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
-
bck
public void bck(int dim)
Description copied from interface:Positionable
Move by -1 in one dimension.- Specified by:
bck
in interfacePositionable
- Parameters:
dim
- dimension
-
fwd
public void fwd(int dim)
Description copied from interface:Positionable
Move by 1 in one dimension.- Specified by:
fwd
in interfacePositionable
- Parameters:
dim
- dimension
-
move
public void move(int distance, int dim)
Description copied from interface:Positionable
Move the element in one dimension for some distance.- Specified by:
move
in interfacePositionable
- Parameters:
distance
- relative offset in dimension ddim
- dimension
-
move
public void move(long distance, int dim)
Description copied from interface:Positionable
Move the element in one dimension for some distance.- Specified by:
move
in interfacePositionable
- Parameters:
distance
- relative offset in dimension ddim
- dimension
-
move
public void move(Localizable localizable)
Description copied from interface:Positionable
Move the element relative to its current location using anLocalizable
as distance vector.- Specified by:
move
in interfacePositionable
- Parameters:
localizable
- relative offset,EuclideanSpace.numDimensions()
must be ≥EuclideanSpace.numDimensions()
-
move
public void move(int[] distance)
Description copied from interface:Positionable
Move the element relative to its current location using an int[] as distance vector.- Specified by:
move
in interfacePositionable
- Parameters:
distance
- relative offset, length must be ≥EuclideanSpace.numDimensions()
-
move
public void move(long[] distance)
Description copied from interface:Positionable
Move the element relative to its current location using a long[] as distance vector.- Specified by:
move
in interfacePositionable
- Parameters:
distance
- relative offset, length must be ≥EuclideanSpace.numDimensions()
-
setPosition
public void setPosition(Localizable localizable)
Description copied from interface:Positionable
Place the element at the same location as a givenLocalizable
- Specified by:
setPosition
in interfacePositionable
- Parameters:
localizable
- absolute position,EuclideanSpace.numDimensions()
must be ≥EuclideanSpace.numDimensions()
-
setPosition
public void setPosition(int[] position)
Description copied from interface:Positionable
Set the position of the element.- Specified by:
setPosition
in interfacePositionable
- Parameters:
position
- absolute position, length must be ≥EuclideanSpace.numDimensions()
-
setPosition
public void setPosition(long[] position)
Description copied from interface:Positionable
Set the position of the element.- Specified by:
setPosition
in interfacePositionable
- Parameters:
position
- absolute position, length must be ≥EuclideanSpace.numDimensions()
-
setPosition
public void setPosition(int position, int d)
Description copied from interface:Positionable
Set the position of the element for one dimension.- Specified by:
setPosition
in interfacePositionable
- Parameters:
position
- absolute position in dimension dd
- dimension
-
setPosition
public void setPosition(long position, int d)
Description copied from interface:Positionable
Set the position of the element for one dimension.- Specified by:
setPosition
in interfacePositionable
- Parameters:
position
- absolute position in dimension dd
- dimension
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-