public abstract class AbstractImg<T> extends Object implements Img<T>
Modifier and Type | Field and Description |
---|---|
protected long[] |
dimension |
protected long[] |
max |
protected int |
n |
protected long |
numPixels |
Constructor and Description |
---|
AbstractImg(long[] size) |
Modifier and Type | Method and Description |
---|---|
long |
dimension(int d)
Get the number of pixels in a given dimension d.
|
void |
dimensions(long[] s)
Write the number of pixels in each dimension into long[].
|
T |
firstElement()
Get the first element of this
IterableRealInterval . |
Iterator<T> |
iterator() |
long |
max(int d)
Get the maximum in dimension d.
|
void |
max(long[] m)
Write the maximum of each dimension into long[].
|
void |
max(Positionable m)
Sets a
Positionable to the maximum of this Interval |
long |
min(int d)
Get the minimum in dimension d.
|
void |
min(long[] m)
Write the minimum of each dimension into long[].
|
void |
min(Positionable m)
Sets a
Positionable to the minimum of this Interval |
int |
numDimensions()
Gets the space's number of dimensions.
|
static long |
numElements(long[] dim) |
RandomAccess<T> |
randomAccess(Interval interval)
Create a random access sampler for integer coordinates.
|
void |
realMax(double[] m)
Write the maximum of each dimension into double[].
|
double |
realMax(int d)
Get the maximum in dimension d.
|
void |
realMax(RealPositionable m)
Sets a
RealPositionable to the maximum of this Interval |
void |
realMin(double[] m)
Write the minimum of each dimension into double[].
|
double |
realMin(int d)
Get the minimum in dimension d.
|
void |
realMin(RealPositionable m)
Sets a
RealPositionable to the minimum of this Interval |
long |
size()
Returns the number of elements in this
Function . |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
randomAccess
cursor, localizingCursor
iterationOrder
forEach, spliterator
protected final int n
protected long numPixels
protected final long[] dimension
protected final long[] max
public T firstElement()
IterableRealInterval
IterableRealInterval
. This is a
shortcut for cursor().next()
.
This can be used to create a new variable of type T using
firstElement().createVariable()
, which is useful in generic
methods to store temporary results, e.g., a running sum over pixels in
the IterableRealInterval
.firstElement
in interface IterableRealInterval<T>
public static long numElements(long[] dim)
public int numDimensions()
EuclideanSpace
numDimensions
in interface EuclideanSpace
public void dimensions(long[] s)
Dimensions
dimensions
in interface Dimensions
public long dimension(int d)
Dimensions
dimension
in interface Dimensions
public long size()
IterableRealInterval
Returns the number of elements in this Function
.
size
in interface IterableRealInterval<T>
public double realMax(int d)
RealInterval
realMax
in interface RealInterval
d
- dimensionpublic void realMax(double[] m)
RealInterval
realMax
in interface RealInterval
public void realMax(RealPositionable m)
RealInterval
RealPositionable
to the maximum of this Interval
realMax
in interface RealInterval
public double realMin(int d)
RealInterval
realMin
in interface RealInterval
d
- dimensionpublic void realMin(double[] m)
RealInterval
realMin
in interface RealInterval
public void realMin(RealPositionable m)
RealInterval
RealPositionable
to the minimum of this Interval
realMin
in interface RealInterval
public long max(int d)
Interval
public void max(long[] m)
Interval
public void max(Positionable m)
Interval
Positionable
to the maximum of this Interval
public void min(long[] m)
Interval
public long min(int d)
Interval
public void min(Positionable m)
Interval
Positionable
to the minimum of this Interval
public RandomAccess<T> randomAccess(Interval interval)
RandomAccessible
The returned random access is intended to be used in the specified
interval only. Thus, the RandomAccessible may provide optimized versions.
If the interval is completely contained in the domain, the random access
is guaranteed to provide the same values as that obtained by
RandomAccessible.randomAccess()
within the interval.
randomAccess
in interface RandomAccessible<T>
interval
- in which interval you intend to use the random access.Copyright © 2009–2018 ImgLib2. All rights reserved.