Class VoxelsFactory
Creates
VoxelsUntyped
and provides a singleton location for implementations of VoxelsFactoryTypeBound
for different types.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptioncreateEmpty
(Extent extent, VoxelDataType dataType) Creates empty voxels to match a particular size.<T> VoxelsUntyped
createFrom
(SliceBufferIndex<T> buffer, VoxelDataType dataType) Creates voxels from a particularSliceBufferIndex
with specified type.static VoxelsFactoryTypeBound
<FloatBuffer> getFloat()
A factory that creates voxels of type float.A factory that creates voxels of type unsigned byte.A factory that creates voxels of type unsigned int.A factory that creates voxels of type unsigned short.static VoxelsFactory
instance()
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 particularSliceBufferIndex
with specified type.- Type Parameters:
T
- the buffer-type to use in the voxels.- Parameters:
buffer
- the buffer to create aVoxelsUntyped
from.dataType
- the data-type that should be compatible withT
.- Returns:
- a newly created
VoxelsUntyped
that reuses the memory inbuffer
.
-
createEmpty
Creates empty voxels to match a particular size.- Parameters:
extent
- the size of theVoxelsUntyped
to 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.
-