Package net.imglib2.img.cell
Class CellImgFactory<T extends NativeType<T>>
java.lang.Object
net.imglib2.img.ImgFactory<T>
net.imglib2.img.NativeImgFactory<T>
net.imglib2.img.cell.CellImgFactory<T>
Factory for creating
CellImgs. The cell dimensions
for a standard cell can be supplied in the constructor of the factory. If no
cell dimensions are given, the factory creates cells of size 10 x 10 x
... x 10.- Author:
- Tobias Pietzsch
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateByteInstance(long[] dimensions, Fraction entitiesPerPixel) createCharInstance(long[] dimensions, Fraction entitiesPerPixel) createDoubleInstance(long[] dimensions, Fraction entitiesPerPixel) createFloatInstance(long[] dimensions, Fraction entitiesPerPixel) createIntInstance(long[] dimensions, Fraction entitiesPerPixel) createLongInstance(long[] dimensions, Fraction entitiesPerPixel) createShortInstance(long[] dimensions, Fraction entitiesPerPixel) static int[]getCellDimensions(int[] defaultCellDimensions, int n, Fraction entitiesPerPixel) Computes cell size array by truncating or expandingdefaultCellDimensionsto lengthn.<S> ImgFactory<S> imgFactory(S type) Creates the sameImgFactoryfor a different generic parameter if possible.static voidverifyDimensions(int[] dimensions) Verify thatdimensionsis not null or empty, and that no dimension is less than 1.static voidverifyDimensions(long[] dimensions) Verify thatdimensionsis not null or empty, and that no dimension is less than 1.Methods inherited from class net.imglib2.img.ImgFactory
create, create, create, create, create, imgFactory
-
Constructor Details
-
CellImgFactory
public CellImgFactory() -
CellImgFactory
public CellImgFactory(int... cellDimensions)
-
-
Method Details
-
verifyDimensions
Verify thatdimensionsis not null or empty, and that no dimension is less than 1. ThrowIllegalArgumentExceptionotherwise.- Parameters:
dimensions-- Throws:
IllegalArgumentException
-
verifyDimensions
Verify thatdimensionsis not null or empty, and that no dimension is less than 1. ThrowIllegalArgumentExceptionotherwise.- Parameters:
dimensions-- Throws:
IllegalArgumentException
-
getCellDimensions
public static int[] getCellDimensions(int[] defaultCellDimensions, int n, Fraction entitiesPerPixel) throws IllegalArgumentException Computes cell size array by truncating or expandingdefaultCellDimensionsto lengthn. Then verifies that a cell does not contain more thanInteger.MAX_VALUEentities.- Parameters:
defaultCellDimensions-n-entitiesPerPixel-- Returns:
- Throws:
IllegalArgumentException
-
create
Description copied from class:NativeImgFactoryThis class will ask theTypeto create a suitableImgfor theTypeand the dimensionality.Typewill then call one of the abstract methods defined below to create theNativeImg- Overrides:
createin classNativeImgFactory<T extends NativeType<T>>- Returns:
Img- the instantiated Container
-
createByteInstance
- Specified by:
createByteInstancein classNativeImgFactory<T extends NativeType<T>>
-
createCharInstance
- Specified by:
createCharInstancein classNativeImgFactory<T extends NativeType<T>>
-
createShortInstance
- Specified by:
createShortInstancein classNativeImgFactory<T extends NativeType<T>>
-
createIntInstance
- Specified by:
createIntInstancein classNativeImgFactory<T extends NativeType<T>>
-
createLongInstance
- Specified by:
createLongInstancein classNativeImgFactory<T extends NativeType<T>>
-
createFloatInstance
- Specified by:
createFloatInstancein classNativeImgFactory<T extends NativeType<T>>
-
createDoubleInstance
- Specified by:
createDoubleInstancein classNativeImgFactory<T extends NativeType<T>>
-
imgFactory
Description copied from class:ImgFactoryCreates the sameImgFactoryfor a different generic parameter if possible. If the type "S" does not suit the needs of theImgFactory(for example implementNativeTypein allNativeImgFactory, this method will throw anIncompatibleTypeException.- Specified by:
imgFactoryin classImgFactory<T extends NativeType<T>>- Type Parameters:
S- the new type- Parameters:
type- an instance of S- Returns:
ImgFactoryof type S- Throws:
IncompatibleTypeException- if type S is not compatible
-