Package net.imglib2.img
Class ImgFactory<T>
- java.lang.Object
-
- net.imglib2.img.ImgFactory<T>
-
- Direct Known Subclasses:
ListImgFactory
,NativeImgFactory
public abstract class ImgFactory<T> extends java.lang.Object
TODO- Author:
- Stephan Preibisch, Stephan Saalfeld
-
-
Constructor Summary
Constructors Constructor Description ImgFactory()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Img<T>
create(int[] dim, T type)
TheImgFactory
can decide how to create theImg
.abstract Img<T>
create(long[] dim, T type)
TheImgFactory
can decide how to create theImg
.Img<T>
create(java.util.function.Supplier<T> typeSupplier, int[] dim)
TheImgFactory
can decide how to create theImg
.Img<T>
create(java.util.function.Supplier<T> typeSupplier, long... dim)
TheImgFactory
can decide how to create theImg
.Img<T>
create(java.util.function.Supplier<T> typeSupplier, Dimensions dim)
TheImgFactory
can decide how to create theImg
.Img<T>
create(Dimensions dim, T type)
TheImgFactory
can decide how to create theImg
.<S> ImgFactory<S>
imgFactory(java.util.function.Supplier<S> typeSupplier)
Creates the sameImgFactory
for a different generic parameter if possible.abstract <S> ImgFactory<S>
imgFactory(S type)
Creates the sameImgFactory
for a different generic parameter if possible.
-
-
-
Method Detail
-
create
public abstract Img<T> create(long[] dim, T type)
TheImgFactory
can decide how to create theImg
. ANativeImgFactory
will ask theType
to create a suitableNativeImg
.- Returns:
Img
-
create
public Img<T> create(Dimensions dim, T type)
TheImgFactory
can decide how to create theImg
. ANativeImgFactory
will ask theType
to create a suitableNativeImg
.- Returns:
Img
-
create
public Img<T> create(int[] dim, T type)
TheImgFactory
can decide how to create theImg
. ANativeImgFactory
will ask theType
to create a suitableNativeImg
.- Returns:
Img
-
imgFactory
public abstract <S> ImgFactory<S> imgFactory(S type) throws IncompatibleTypeException
Creates the sameImgFactory
for a different generic parameter if possible. If the type "S" does not suit the needs of theImgFactory
(for example implementNativeType
in allNativeImgFactory
, this method will throw anIncompatibleTypeException
.- Type Parameters:
S
- the new type- Parameters:
type
- an instance of S- Returns:
ImgFactory
of type S- Throws:
IncompatibleTypeException
- if type S is not compatible
-
create
public Img<T> create(java.util.function.Supplier<T> typeSupplier, long... dim)
TheImgFactory
can decide how to create theImg
. ANativeImgFactory
will ask the suppliedType
to create a suitableNativeImg
.- Returns:
Img
-
create
public Img<T> create(java.util.function.Supplier<T> typeSupplier, Dimensions dim)
TheImgFactory
can decide how to create theImg
. ANativeImgFactory
will ask the suppliedType
to create a suitableNativeImg
.- Returns:
Img
-
create
public Img<T> create(java.util.function.Supplier<T> typeSupplier, int[] dim)
TheImgFactory
can decide how to create theImg
. ANativeImgFactory
will ask the suppliedType
to create a suitableNativeImg
.Note: This is not a vararg function because the underlying int[] based methods alreay copies the int[] dimensions into a disposable long[] anyways. This would be an unnecessary copy for int... varargs.
- Returns:
Img
-
imgFactory
public <S> ImgFactory<S> imgFactory(java.util.function.Supplier<S> typeSupplier) throws IncompatibleTypeException
Creates the sameImgFactory
for a different generic parameter if possible. If the supplied type "S" does not suit the needs of theImgFactory
(for example implementNativeType
in allNativeImgFactory
, this method will throw anIncompatibleTypeException
.- Type Parameters:
S
- the new type- Parameters:
typeSupplier
- a supplier of S- Returns:
ImgFactory
of type S- Throws:
IncompatibleTypeException
- if type S is not compatible
-
-