Class VoxelsFactory
Object
org.anchoranalysis.image.voxel.datatype.VoxelDataTypeFactoryMultiplexer<VoxelsFactoryTypeBound<?>>
org.anchoranalysis.image.voxel.factory.VoxelsFactory
public class VoxelsFactory extends VoxelDataTypeFactoryMultiplexer<VoxelsFactoryTypeBound<?>>
Creates
VoxelsUntyped and provides a singleton location for implementations of VoxelsFactoryTypeBound for different types.- Author:
- Owen Feehan
-
Method Summary
Modifier and Type Method Description VoxelsUntypedcreateEmpty(Extent extent, VoxelDataType dataType)Creates empty voxels to match a particular size.<T> VoxelsUntypedcreateFrom(SliceBufferIndex<T> buffer, VoxelDataType dataType)Creates voxels from a particularSliceBufferIndexwith specified type.static VoxelsFactoryTypeBound<FloatBuffer>getFloat()A factory that creates voxels of type float.static VoxelsFactoryTypeBound<UnsignedByteBuffer>getUnsignedByte()A factory that creates voxels of type unsigned byte.static VoxelsFactoryTypeBound<UnsignedIntBuffer>getUnsignedInt()A factory that creates voxels of type unsigned int.static VoxelsFactoryTypeBound<UnsignedShortBuffer>getUnsignedShort()A factory that creates voxels of type unsigned short.static VoxelsFactoryinstance()Singleton instance.Methods inherited from class org.anchoranalysis.image.voxel.datatype.VoxelDataTypeFactoryMultiplexer
get
-
Method Details
-
instance
Singleton instance.- Returns:
- a single instance of this class.
-
createFrom
Creates voxels from a particularSliceBufferIndexwith specified type.- Type Parameters:
T- the buffer-type to use in the voxels.- Parameters:
buffer- the buffer to create aVoxelsUntypedfrom.dataType- the data-type that should be compatible withT.- Returns:
- a newly created
VoxelsUntypedthat reuses the memory inbuffer.
-
createEmpty
Creates empty voxels to match a particular size.- Parameters:
extent- the size of theVoxelsUntypedto create.dataType- the voxel data-type to create.- Returns:
- the created voxels.
-
getUnsignedByte
A factory that creates voxels of type unsigned byte.- Returns:
- the corresponding factory.
-
getUnsignedShort
A factory that creates voxels of type unsigned short.- Returns:
- the corresponding factory.
-
getUnsignedInt
A factory that creates voxels of type unsigned int.- Returns:
- the corresponding factory.
-
getFloat
A factory that creates voxels of type float.- Returns:
- the corresponding factory.
-