public class CellImgFactory<T extends NativeType<T>> extends NativeImgFactory<T>
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.Constructor and Description |
---|
CellImgFactory() |
CellImgFactory(int... cellDimensions) |
Modifier and Type | Method and Description |
---|---|
CellImg<T,?> |
create(long[] dim,
T type)
|
CellImg<T,ByteArray> |
createByteInstance(long[] dimensions,
Fraction entitiesPerPixel) |
CellImg<T,CharArray> |
createCharInstance(long[] dimensions,
Fraction entitiesPerPixel) |
CellImg<T,DoubleArray> |
createDoubleInstance(long[] dimensions,
Fraction entitiesPerPixel) |
CellImg<T,FloatArray> |
createFloatInstance(long[] dimensions,
Fraction entitiesPerPixel) |
CellImg<T,IntArray> |
createIntInstance(long[] dimensions,
Fraction entitiesPerPixel) |
CellImg<T,LongArray> |
createLongInstance(long[] dimensions,
Fraction entitiesPerPixel) |
CellImg<T,ShortArray> |
createShortInstance(long[] dimensions,
Fraction entitiesPerPixel) |
static int[] |
getCellDimensions(int[] defaultCellDimensions,
int n,
Fraction entitiesPerPixel)
Computes cell size array by truncating or expanding
defaultCellDimensions to length n . |
<S> ImgFactory<S> |
imgFactory(S type)
Creates the same
ImgFactory for a different generic parameter if
possible. |
static void |
verifyDimensions(int[] dimensions)
Verify that
dimensions is not null or empty, and that no
dimension is less than 1. |
static void |
verifyDimensions(long[] dimensions)
Verify that
dimensions is not null or empty, and that no
dimension is less than 1. |
create, create, create, create, create, imgFactory
public CellImgFactory()
public CellImgFactory(int... cellDimensions)
public static void verifyDimensions(int[] dimensions) throws IllegalArgumentException
dimensions
is not null or empty, and that no
dimension is less than 1. Throw IllegalArgumentException
otherwise.dimensions
- IllegalArgumentException
public static void verifyDimensions(long[] dimensions) throws IllegalArgumentException
dimensions
is not null or empty, and that no
dimension is less than 1. Throw IllegalArgumentException
otherwise.dimensions
- IllegalArgumentException
public static int[] getCellDimensions(int[] defaultCellDimensions, int n, Fraction entitiesPerPixel) throws IllegalArgumentException
defaultCellDimensions
to length n
. Then verifies that a
cell does not contain more than Integer.MAX_VALUE
entities.defaultCellDimensions
- n
- entitiesPerPixel
- IllegalArgumentException
public CellImg<T,?> create(long[] dim, T type)
NativeImgFactory
Type
to create a suitable Img
for
the Type
and the dimensionality.
Type
will then call one of the abstract methods defined below to
create the NativeImg
create
in class NativeImgFactory<T extends NativeType<T>>
Img
- the instantiated Containerpublic CellImg<T,ByteArray> createByteInstance(long[] dimensions, Fraction entitiesPerPixel)
createByteInstance
in class NativeImgFactory<T extends NativeType<T>>
public CellImg<T,CharArray> createCharInstance(long[] dimensions, Fraction entitiesPerPixel)
createCharInstance
in class NativeImgFactory<T extends NativeType<T>>
public CellImg<T,ShortArray> createShortInstance(long[] dimensions, Fraction entitiesPerPixel)
createShortInstance
in class NativeImgFactory<T extends NativeType<T>>
public CellImg<T,IntArray> createIntInstance(long[] dimensions, Fraction entitiesPerPixel)
createIntInstance
in class NativeImgFactory<T extends NativeType<T>>
public CellImg<T,LongArray> createLongInstance(long[] dimensions, Fraction entitiesPerPixel)
createLongInstance
in class NativeImgFactory<T extends NativeType<T>>
public CellImg<T,FloatArray> createFloatInstance(long[] dimensions, Fraction entitiesPerPixel)
createFloatInstance
in class NativeImgFactory<T extends NativeType<T>>
public CellImg<T,DoubleArray> createDoubleInstance(long[] dimensions, Fraction entitiesPerPixel)
createDoubleInstance
in class NativeImgFactory<T extends NativeType<T>>
public <S> ImgFactory<S> imgFactory(S type) throws IncompatibleTypeException
ImgFactory
ImgFactory
for a different generic parameter if
possible.
If the type "S" does not suit the needs of the ImgFactory
(for
example implement NativeType
in all NativeImgFactory
,
this method will throw an IncompatibleTypeException
.imgFactory
in class ImgFactory<T extends NativeType<T>>
S
- the new typetype
- an instance of SImgFactory
of type SIncompatibleTypeException
- if type S is not compatibleCopyright © 2009–2018 ImgLib2. All rights reserved.