Package net.imglib2.img
Class AbstractImg<T>
java.lang.Object
net.imglib2.img.AbstractImg<T>
- All Implemented Interfaces:
Iterable<T>
,Dimensions
,EuclideanSpace
,Img<T>
,Interval
,IterableInterval<T>
,IterableRealInterval<T>
,RandomAccessible<T>
,RandomAccessibleInterval<T>
,RealInterval
- Direct Known Subclasses:
AbstractListImg
,AbstractLongListImg
,AbstractNativeImg
TODO
- Author:
- Stephan Preibisch, Stephan Saalfeld
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlong
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[].Get the first element of thisIterableRealInterval
.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 aPositionable
to the maximum of thisInterval
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 aPositionable
to the minimum of thisInterval
int
Gets the space's number of dimensions.static long
numElements
(long[] dim) 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
Sets aRealPositionable
to the maximum of thisInterval
void
realMin
(double[] m) Write the minimum of each dimension into double[].double
realMin
(int d) Get the minimum in dimension d.void
Sets aRealPositionable
to the minimum of thisInterval
long
size()
Returns the number of elements in thisFunction
.toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface net.imglib2.IterableInterval
cursor, localizingCursor
Methods inherited from interface net.imglib2.IterableRealInterval
iterationOrder
Methods inherited from interface net.imglib2.RandomAccessible
randomAccess
-
Field Details
-
n
protected final int n -
numPixels
protected long numPixels -
dimension
protected final long[] dimension -
max
protected final long[] max
-
-
Constructor Details
-
AbstractImg
public AbstractImg(long[] size)
-
-
Method Details
-
iterator
-
firstElement
Description copied from interface:IterableRealInterval
Get the first element of thisIterableRealInterval
. This is a shortcut forcursor().next()
. This can be used to create a new variable of type T usingfirstElement().createVariable()
, which is useful in generic methods to store temporary results, e.g., a running sum over pixels in theIterableRealInterval
.- Specified by:
firstElement
in interfaceIterableRealInterval<T>
- Returns:
- the first element in iteration order.
-
numElements
public static long numElements(long[] dim) -
numDimensions
public int numDimensions()Description copied from interface:EuclideanSpace
Gets the space's number of dimensions.- Specified by:
numDimensions
in interfaceEuclideanSpace
-
dimensions
public void dimensions(long[] s) Description copied from interface:Dimensions
Write the number of pixels in each dimension into long[].- Specified by:
dimensions
in interfaceDimensions
- Parameters:
s
-
-
dimension
public long dimension(int d) Description copied from interface:Dimensions
Get the number of pixels in a given dimension d.- Specified by:
dimension
in interfaceDimensions
- Parameters:
d
-
-
size
public long size()Description copied from interface:IterableRealInterval
Returns the number of elements in this
Function
.- Specified by:
size
in interfaceIterableRealInterval<T>
- Returns:
- number of elements
-
toString
-
realMax
public double realMax(int d) Description copied from interface:RealInterval
Get the maximum in dimension d.- Specified by:
realMax
in interfaceRealInterval
- Parameters:
d
- dimension- Returns:
- maximum in dimension d.
-
realMax
public void realMax(double[] m) Description copied from interface:RealInterval
Write the maximum of each dimension into double[].- Specified by:
realMax
in interfaceRealInterval
- Parameters:
m
-
-
realMax
Description copied from interface:RealInterval
Sets aRealPositionable
to the maximum of thisInterval
- Specified by:
realMax
in interfaceRealInterval
- Parameters:
m
-
-
realMin
public double realMin(int d) Description copied from interface:RealInterval
Get the minimum in dimension d.- Specified by:
realMin
in interfaceRealInterval
- Parameters:
d
- dimension- Returns:
- minimum in dimension d.
-
realMin
public void realMin(double[] m) Description copied from interface:RealInterval
Write the minimum of each dimension into double[].- Specified by:
realMin
in interfaceRealInterval
- Parameters:
m
-
-
realMin
Description copied from interface:RealInterval
Sets aRealPositionable
to the minimum of thisInterval
- Specified by:
realMin
in interfaceRealInterval
- Parameters:
m
-
-
max
public long max(int d) Description copied from interface:Interval
Get the maximum in dimension d. -
max
public void max(long[] m) Description copied from interface:Interval
Write the maximum of each dimension into long[]. -
max
Description copied from interface:Interval
Sets aPositionable
to the maximum of thisInterval
-
min
public void min(long[] m) Description copied from interface:Interval
Write the minimum of each dimension into long[]. -
min
public long min(int d) Description copied from interface:Interval
Get the minimum in dimension d. -
min
Description copied from interface:Interval
Sets aPositionable
to the minimum of thisInterval
-
randomAccess
Description copied from interface:RandomAccessible
Create a random access sampler for integer coordinates.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.- Specified by:
randomAccess
in interfaceRandomAccessible<T>
- Parameters:
interval
- in which interval you intend to use the random access.- Returns:
- random access sampler
-