Package net.imglib2
Interface RandomAccess<T>
-
- All Superinterfaces:
EuclideanSpace,Localizable,Positionable,RealLocalizable,Sampler<T>,Typed<T>
- All Known Subinterfaces:
OutOfBounds<T>,RealOutOfBounds<T>
- All Known Implementing Classes:
AbstractConvertedRandomAccess,AbstractLongListImg.LongListRandomAccess,AbstractOutOfBoundsMirror,AbstractOutOfBoundsValue,ArrayRandomAccess,BiConvertedRandomAccess,BundleView.BundleRandomAccess,CellGrid.CellIntervalsRA,CellRandomAccess,CompositeView.CompositeRandomAccess,ConvertedRandomAccess,FullSourceMapMixedRandomAccess,FullSourceMapSlicingRandomAccess,FunctionRandomAccessible.FunctionRandomAccess,FunctionView.FunctionRandomAccess,Grid.CellIntervalsRA,HyperSlice.HyperSliceRandomAccess,HyperSlicesView.HyperSlicesViewRandomAccess,InflateView.InflateRandomAccess,InterleaveView.InterleaveRandomAccess,ListRandomAccess,Localizables.LocationRandomAccess,MixedRandomAccess,NtreeRandomAccess,OutOfBoundsBorder,OutOfBoundsConstantValue,OutOfBoundsMirrorDoubleBoundary,OutOfBoundsMirrorExpWindowing,OutOfBoundsMirrorSingleBoundary,OutOfBoundsPeriodic,OutOfBoundsRandomValue,PlanarRandomAccess,PlanarRandomAccess1D,PointSample,PositionRandomAccessible.PositionRandomAccess,RandomAccessibleOnRealRandomAccessible.RandomAccessOnRealRandomAccessible,RandomAccessiblePair.RandomAccess,SlicingRandomAccess,StackView.DefaultRA,StackView.MoveAllSlicesRA,SubsampleView.SubsampleRandomAccess,TransformRandomAccess,TranslationRandomAccess,WriteConvertedRandomAccess
public interface RandomAccess<T> extends Localizable, Positionable, Sampler<T>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description RandomAccess<T>copy()default RandomAccess<T>copyRandomAccess()Deprecated.default TsetPositionAndGet(int... position)Convenience method that moves theRealRandomAccessto the given position and gets the value at that position.default TsetPositionAndGet(long... position)Convenience method that moves theRealRandomAccessto the given position and gets the value at that position.default TsetPositionAndGet(Localizable position)Convenience method that moves theRealRandomAccessto the given position and gets the value at that position.-
Methods inherited from interface net.imglib2.EuclideanSpace
numDimensions
-
Methods inherited from interface net.imglib2.Localizable
getDoublePosition, getFloatPosition, getIntPosition, getLongPosition, localize, localize, localize, localize, positionAsLongArray, positionAsPoint
-
Methods inherited from interface net.imglib2.Positionable
bck, fwd, move, move, move, move, move, setPosition, setPosition, setPosition, setPosition, setPosition
-
Methods inherited from interface net.imglib2.RealLocalizable
localize, localize, positionAsDoubleArray, positionAsRealPoint
-
-
-
-
Method Detail
-
copyRandomAccess
@Deprecated default RandomAccess<T> copyRandomAccess()
Deprecated.
-
copy
RandomAccess<T> copy()
- Specified by:
copyin interfaceSampler<T>- Returns:
- - A new
Samplerin the same state accessing the same values. It does NOT copy T, just the state of theSampler. 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 anArrayCursorfor example)
-
setPositionAndGet
default T setPositionAndGet(long... position)
Convenience method that moves theRealRandomAccessto the given position and gets the value at that position. It's a shortcut for:setPosition( position ); get();WARNING: The return value is invalidated by next call to
setPositionAndGet(long...)orPositionable.setPosition(net.imglib2.Localizable).// This is wrong!!! a = randomAccess.setPositionAndGet( positionA ); b = randomAccess.setPositionAndGet( positionB ); // this invalidates "a" !!! wrongDifference = a.getRealDouble() - b.getRealDouble(); // Correct: // Use individual RandomAccesses to query a and b a = randomAccess_A.setPositionAndGet( positionA ); b = randomAccess_B.setPositionAndGet( positionB ); // this is fine because a different RandomAccess is used difference = a.getRealDouble() - b.getRealDouble();
-
setPositionAndGet
default T setPositionAndGet(int... position)
Convenience method that moves theRealRandomAccessto the given position and gets the value at that position. It's a shortcut for:setPosition( position ); get();WARNING: The return value is invalidated by next call to
setPositionAndGet(long...)orPositionable.setPosition(net.imglib2.Localizable).// This is wrong!!! a = randomAccess.setPositionAndGet( positionA ); b = randomAccess.setPositionAndGet( positionB ); // this invalidates "a" !!! wrongDifference = a.getRealDouble() - b.getRealDouble(); // Correct: // Use individual RandomAccesses to query a and b a = randomAccess_A.setPositionAndGet( positionA ); b = randomAccess_B.setPositionAndGet( positionB ); // this is fine because a different RandomAccess is used difference = a.getRealDouble() - b.getRealDouble();
-
setPositionAndGet
default T setPositionAndGet(Localizable position)
Convenience method that moves theRealRandomAccessto the given position and gets the value at that position. It's a shortcut for:setPosition( position ); get();WARNING: The return value is invalidated by next call to
setPositionAndGet(long...)orPositionable.setPosition(net.imglib2.Localizable).// This is wrong!!! a = randomAccess.setPositionAndGet( positionA ); b = randomAccess.setPositionAndGet( positionB ); // this invalidates "a" !!! wrongDifference = a.getRealDouble() - b.getRealDouble(); // Correct: // Use individual RandomAccesses to query a and b a = randomAccess_A.setPositionAndGet( positionA ); b = randomAccess_B.setPositionAndGet( positionB ); // this is fine because a different RandomAccess is used difference = a.getRealDouble() - b.getRealDouble();
-
-