Module org.bigdataviewer.core
Package bdv.util
Class AbstractSource<T extends net.imglib2.type.numeric.NumericType<T>>
- java.lang.Object
-
- bdv.util.AbstractSource<T>
-
- All Implemented Interfaces:
Source<T>
- Direct Known Subclasses:
RandomAccessibleIntervalMipmapSource,RandomAccessibleIntervalMipmapSource4D,RandomAccessibleIntervalSource,RandomAccessibleIntervalSource4D,RandomAccessibleSource,RandomAccessibleSource4D,VolatileSource
public abstract class AbstractSource<T extends net.imglib2.type.numeric.NumericType<T>> extends Object implements Source<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected DefaultInterpolators<T>interpolatorsprotected Stringnameprotected Ttypeprotected mpicbg.spim.data.sequence.VoxelDimensionsvoxelDimensions
-
Constructor Summary
Constructors Constructor Description AbstractSource(Supplier<T> typeSupplier, String name)AbstractSource(T type, String name)AbstractSource(T type, String name, boolean doBoundingBoxCulling)AbstractSource(T type, String name, mpicbg.spim.data.sequence.VoxelDimensions voxelDimensions)AbstractSource(T type, String name, mpicbg.spim.data.sequence.VoxelDimensions voxelDimensions, boolean doBoundingBoxCulling)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandoBoundingBoxCulling()Whether this source participates in bounding box culling.net.imglib2.RealRandomAccessible<? extends net.imglib2.type.mask.Masked<T>>getInterpolatedMaskedSource(int t, int level, Interpolation method)Get aMaskedversion of the3D stackat timepoint index t, extended to infinity and interpolated.net.imglib2.RealRandomAccessible<T>getInterpolatedSource(int t, int level, Interpolation method)Get the 3D stack at timepoint index t, extended to infinity and interpolated.net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.mask.Masked<T>>getMaskedSource(int t, int level)Get aMaskedversion of the3D stackat timepoint index t.StringgetName()Get the name of the source.intgetNumMipmapLevels()TgetType()Get an instance of the pixel type.mpicbg.spim.data.sequence.VoxelDimensionsgetVoxelDimensions()Get voxel size and unit for this source.booleanisPresent(int t)Is there a stack at timepoint index t?-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface bdv.viewer.Source
getSource, getSourceTransform
-
-
-
-
Field Detail
-
type
protected final T extends net.imglib2.type.numeric.NumericType<T> type
-
name
protected final String name
-
voxelDimensions
protected final mpicbg.spim.data.sequence.VoxelDimensions voxelDimensions
-
interpolators
protected final DefaultInterpolators<T extends net.imglib2.type.numeric.NumericType<T>> interpolators
-
-
Constructor Detail
-
AbstractSource
public AbstractSource(T type, String name, mpicbg.spim.data.sequence.VoxelDimensions voxelDimensions, boolean doBoundingBoxCulling)
-
AbstractSource
public AbstractSource(T type, String name, mpicbg.spim.data.sequence.VoxelDimensions voxelDimensions)
-
-
Method Detail
-
isPresent
public boolean isPresent(int t)
Description copied from interface:SourceIs there a stack at timepoint index t?- Specified by:
isPresentin interfaceSource<T extends net.imglib2.type.numeric.NumericType<T>>- Parameters:
t- timepoint index- Returns:
- true, if there is data for timepoint index t.
-
getType
public T getType()
Description copied from interface:SourceGet an instance of the pixel type.- Specified by:
getTypein interfaceSource<T extends net.imglib2.type.numeric.NumericType<T>>- Returns:
- instance of pixel type.
-
getInterpolatedSource
public net.imglib2.RealRandomAccessible<T> getInterpolatedSource(int t, int level, Interpolation method)
Description copied from interface:SourceGet the 3D stack at timepoint index t, extended to infinity and interpolated.- Specified by:
getInterpolatedSourcein interfaceSource<T extends net.imglib2.type.numeric.NumericType<T>>- Parameters:
t- timepoint indexlevel- mipmap levelmethod- interpolation method to use- Returns:
- the extended and interpolated
stack.
-
getMaskedSource
public net.imglib2.RandomAccessibleInterval<? extends net.imglib2.type.mask.Masked<T>> getMaskedSource(int t, int level)
Description copied from interface:SourceGet aMaskedversion of the3D stackat timepoint index t.By default, this is just
Source.getSource(int, int)augmented with a constant mask1.0.- Specified by:
getMaskedSourcein interfaceSource<T extends net.imglib2.type.numeric.NumericType<T>>- Parameters:
t- timepoint indexlevel- mipmap level- Returns:
- the masked stack
-
getInterpolatedMaskedSource
public net.imglib2.RealRandomAccessible<? extends net.imglib2.type.mask.Masked<T>> getInterpolatedMaskedSource(int t, int level, Interpolation method)
Description copied from interface:SourceGet aMaskedversion of the3D stackat timepoint index t, extended to infinity and interpolated.By default, this is just
Source.getInterpolatedSource(int, int, bdv.viewer.Interpolation)augmented with a constant mask1.0.However, most sources should override this to extend
Source.getMaskedSource(int, int)to infinity (with a0mask) and interpolate.- Specified by:
getInterpolatedMaskedSourcein interfaceSource<T extends net.imglib2.type.numeric.NumericType<T>>- Parameters:
t- timepoint indexlevel- mipmap levelmethod- interpolation method to use- Returns:
- the extended and interpolated
stack.
-
getName
public String getName()
Description copied from interface:SourceGet the name of the source.- Specified by:
getNamein interfaceSource<T extends net.imglib2.type.numeric.NumericType<T>>- Returns:
- the name of the source.
-
getVoxelDimensions
public mpicbg.spim.data.sequence.VoxelDimensions getVoxelDimensions()
Description copied from interface:SourceGet voxel size and unit for this source. May return null.- Specified by:
getVoxelDimensionsin interfaceSource<T extends net.imglib2.type.numeric.NumericType<T>>- Returns:
- voxel size and unit or
null.
-
getNumMipmapLevels
public int getNumMipmapLevels()
- Specified by:
getNumMipmapLevelsin interfaceSource<T extends net.imglib2.type.numeric.NumericType<T>>
-
doBoundingBoxCulling
public boolean doBoundingBoxCulling()
Description copied from interface:SourceWhether this source participates in bounding box culling.If
true, then this source will only be rendered if its bounding box, i.e., the interval ofSource.getSource(int, int), intersects the current screen area (when transformed to viewer coordinates).If
false, then this source will be always rendered (if it is set to be visible.)- Specified by:
doBoundingBoxCullingin interfaceSource<T extends net.imglib2.type.numeric.NumericType<T>>- Returns:
true, if this source participates in bounding box culling.
-
-