public final class NtreeRandomAccess<T extends NativeType<T>> extends Object implements NtreeImg.PositionProvider, RandomAccess<T>
Constructor and Description |
---|
NtreeRandomAccess(NtreeImg<T,?> img) |
Modifier and Type | Method and Description |
---|---|
void |
bck(int d)
Move by -1 in one dimension.
|
NtreeRandomAccess<T> |
copy() |
NtreeRandomAccess<T> |
copyRandomAccess() |
void |
fwd(int d)
Move by 1 in one dimension.
|
T |
get()
Access the actual T instance providing access to a pixel,
sub-pixel or integral region value the
Sampler points at. |
double |
getDoublePosition(int dim)
Return the current position in a given dimension.
|
float |
getFloatPosition(int dim)
Return the current position in a given dimension.
|
int |
getIntPosition(int dim)
Return the current position in a given dimension.
|
long |
getLongPosition(int dim)
Return the current position in a given dimension.
|
long[] |
getPosition() |
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.
|
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(Localizable localizable)
Move the element relative to its current location using an
Localizable as distance vector. |
void |
move(long[] distance)
Move the element relative to its current location using a long[] as
distance vector.
|
void |
move(long distance,
int d)
Move the element in one dimension for some distance.
|
int |
numDimensions()
Gets the space's number of dimensions.
|
void |
setPosition(int[] pos)
Set the position of the element.
|
void |
setPosition(int position,
int dim)
Set the position of the element for one dimension.
|
void |
setPosition(Localizable localizable)
Place the element at the same location as a given
Localizable |
void |
setPosition(long[] pos)
Set the position of the element.
|
void |
setPosition(long pos,
int d)
Set the position of the element for one dimension.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setPositionAndGet, setPositionAndGet, setPositionAndGet
localize, positionAsLongArray, positionAsPoint
localize, positionAsDoubleArray, positionAsRealPoint
public void fwd(int d)
Positionable
fwd
in interface Positionable
d
- dimensionpublic void bck(int d)
Positionable
bck
in interface Positionable
d
- dimensionpublic void move(long distance, int d)
Positionable
move
in interface Positionable
distance
- relative offset in dimension dd
- dimensionpublic void setPosition(int[] pos)
Positionable
setPosition
in interface Positionable
pos
- absolute position, length must be ≥
EuclideanSpace.numDimensions()
public void setPosition(long[] pos)
Positionable
setPosition
in interface Positionable
pos
- absolute position, length must be ≥
EuclideanSpace.numDimensions()
public void setPosition(long pos, int d)
Positionable
setPosition
in interface Positionable
pos
- absolute position in dimension dd
- dimensionpublic T get()
Sampler
Sampler
points at.get
in interface Sampler<T extends NativeType<T>>
public NtreeRandomAccess<T> copy()
copy
in interface Sampler<T extends NativeType<T>>
Sampler
in the same state accessing the same
values.
It does NOT copy T, just the state of the Sampler
.
Otherwise use T.copy() if available.
Sampler.copy().get() == Sampler.get(), i.e. both hold the same
value, not necessarily the same instance (this is the case for an
ArrayCursor
for example)public NtreeRandomAccess<T> copyRandomAccess()
copyRandomAccess
in interface RandomAccess<T extends NativeType<T>>
public long[] getPosition()
getPosition
in interface NtreeImg.PositionProvider
public void move(int distance, int dim)
Positionable
move
in interface Positionable
distance
- relative offset in dimension ddim
- dimensionpublic void setPosition(int position, int dim)
Positionable
setPosition
in interface Positionable
position
- absolute position in dimension ddim
- dimensionpublic void move(int[] distance)
Positionable
move
in interface Positionable
distance
- relative offset, length must be ≥ EuclideanSpace.numDimensions()
public void move(long[] distance)
Positionable
move
in interface Positionable
distance
- relative offset, length must be ≥ EuclideanSpace.numDimensions()
public void move(Localizable localizable)
Positionable
Localizable
as distance vector.move
in interface Positionable
localizable
- relative offset, EuclideanSpace.numDimensions()
must be
≥ EuclideanSpace.numDimensions()
public void setPosition(Localizable localizable)
Positionable
Localizable
setPosition
in interface Positionable
localizable
- absolute position, EuclideanSpace.numDimensions()
must be
≥ EuclideanSpace.numDimensions()
public void localize(float[] pos)
RealLocalizable
localize
in interface RealLocalizable
pos
- receives current positionpublic void localize(double[] pos)
RealLocalizable
localize
in interface RealLocalizable
pos
- receives current positionpublic void localize(int[] pos)
Localizable
localize
in interface Localizable
pos
- receives current positionpublic void localize(long[] pos)
Localizable
localize
in interface Localizable
pos
- receives current positionpublic float getFloatPosition(int dim)
RealLocalizable
getFloatPosition
in interface Localizable
getFloatPosition
in interface RealLocalizable
dim
- dimensionpublic double getDoublePosition(int dim)
RealLocalizable
getDoublePosition
in interface Localizable
getDoublePosition
in interface RealLocalizable
dim
- dimensionpublic int getIntPosition(int dim)
Localizable
getIntPosition
in interface Localizable
dim
- dimensionpublic long getLongPosition(int dim)
Localizable
getLongPosition
in interface Localizable
dim
- dimensionpublic int numDimensions()
EuclideanSpace
numDimensions
in interface EuclideanSpace
Copyright © 2015–2022 ImgLib2. All rights reserved.