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>
-
public class CellImgFactory<T extends NativeType<T>> extends NativeImgFactory<T>
Factory for creatingCellImgs. 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.
-
-
Field Summary
Fields Modifier and Type Field Description private int[]defaultCellDimensions
-
Constructor Summary
Constructors Constructor Description CellImgFactory()Deprecated.CellImgFactory(int... cellDimensions)Deprecated.CellImgFactory(T type)CellImgFactory(T type, int... cellDimensions)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CellImg<T,?>create(int[] dimensions)Create anImg<T>with the specifieddimensions.CellImg<T,?>create(long... dimensions)Create aNativeImgwith the specifieddimensions.CellImg<T,?>create(long[] dimensions, T type)Deprecated.private <A extends ArrayDataAccess<A>>
CellImg<T,A>create(long[] dimensions, T type, NativeTypeFactory<T,A> typeFactory)CellImg<T,?>create(Dimensions dimensions)Create anImg<T>with the specifieddimensions.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)Deprecated.This method has been deprecated in favor ofDimensions.verify(int...).static voidverifyDimensions(long[] dimensions)Deprecated.This method has been deprecated in favor ofDimensions.verify(long...).-
Methods inherited from class net.imglib2.img.ImgFactory
cache, create, create, create, create, create, imgFactory, type
-
-
-
-
Method Detail
-
getCellDimensions
public static int[] getCellDimensions(int[] defaultCellDimensions, int n, Fraction entitiesPerPixel) throws java.lang.IllegalArgumentExceptionComputes 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:
java.lang.IllegalArgumentException
-
create
public CellImg<T,?> create(long... dimensions)
Description copied from class:NativeImgFactoryCreate aNativeImgwith the specifieddimensions.- Specified by:
createin classNativeImgFactory<T extends NativeType<T>>- Parameters:
dimensions- the dimensions of the image.- Returns:
- new
NativeImgwith the specifieddimensions.
-
create
public CellImg<T,?> create(Dimensions dimensions)
Description copied from class:NativeImgFactoryCreate anImg<T>with the specifieddimensions.- Overrides:
createin classNativeImgFactory<T extends NativeType<T>>- Returns:
- new image with the specified
dimensions.
-
create
public CellImg<T,?> create(int[] dimensions)
Description copied from class:NativeImgFactoryCreate anImg<T>with the specifieddimensions.Note: This is not a vararg function because the underlying
int[]based methods already copies theint[]dimensions into a disposablelong[]anyways. This would be an unnecessary copy forint...varargs.- Overrides:
createin classNativeImgFactory<T extends NativeType<T>>- Returns:
- new image with the specified
dimensions.
-
create
private <A extends ArrayDataAccess<A>> CellImg<T,A> create(long[] dimensions, T type, NativeTypeFactory<T,A> typeFactory)
-
imgFactory
public <S> ImgFactory<S> imgFactory(S type) throws IncompatibleTypeException
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
-
create
@Deprecated public CellImg<T,?> create(long[] dimensions, T type)
Deprecated.- Specified by:
createin classNativeImgFactory<T extends NativeType<T>>
-
verifyDimensions
@Deprecated public static void verifyDimensions(int[] dimensions) throws java.lang.IllegalArgumentExceptionDeprecated.This method has been deprecated in favor ofDimensions.verify(int...).- Throws:
java.lang.IllegalArgumentException
-
verifyDimensions
@Deprecated public static void verifyDimensions(long[] dimensions) throws java.lang.IllegalArgumentExceptionDeprecated.This method has been deprecated in favor ofDimensions.verify(long...).- Throws:
java.lang.IllegalArgumentException
-
-