Class BinaryVoxelsFactory
Object
BinaryVoxelsFactory
Creates
BinaryVoxels
parameterized by size and initial state.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic BinaryVoxels
<UnsignedByteBuffer> createEmptyOff
(Extent extent) Creates binary-voxels using unsigned 8-bit byte type and with all voxels set to off (0).static BinaryVoxels
<?> createEmptyOff
(Extent extent, VoxelDataType dataType) Creates an empty binary-voxels of a particular data-type with all voxels initialized to off. (0).static BinaryVoxels
<UnsignedByteBuffer> createEmptyOn
(Extent extent) Creates binary-voxels using unsigned 8-bit byte type and with all voxels set to on (255).static BinaryVoxels
<UnsignedByteBuffer> reuseByte
(Voxels<UnsignedByteBuffer> voxels) LikereuseByte(org.anchoranalysis.image.voxel.Voxels<org.anchoranalysis.image.voxel.buffer.primitive.UnsignedByteBuffer>)
but uses default binary-values for off (0) and on (255).static BinaryVoxels
<UnsignedByteBuffer> reuseByte
(Voxels<UnsignedByteBuffer> voxels, BinaryValuesInt binaryValues) Reuses an existing voxel-buffer (of type unsigned byte) as a binary-version which should have only two intensity-values representing off and on.static BinaryVoxels
<UnsignedIntBuffer> reuseInt
(Voxels<UnsignedIntBuffer> voxels, BinaryValuesInt binaryValues) Reuses an existing voxel-buffer (of type unsigned int) as a binary-version which should have only two intensity-values representing off and on.
-
Method Details
-
createEmptyOn
Creates binary-voxels using unsigned 8-bit byte type and with all voxels set to on (255).- Parameters:
extent
- the size of the voxels.- Returns:
- newly created binary-voxels of specified size with all voxels initialized to on.
-
createEmptyOff
Creates binary-voxels using unsigned 8-bit byte type and with all voxels set to off (0).- Parameters:
extent
- the size of the voxels.- Returns:
- newly created binary-voxels of specified size with all voxels initialized to off.
-
createEmptyOff
public static BinaryVoxels<?> createEmptyOff(Extent extent, VoxelDataType dataType) throws CreateException Creates an empty binary-voxels of a particular data-type with all voxels initialized to off. (0).- Parameters:
extent
- the size of the voxels.dataType
- the data-type of the underlying voxel-buffer, either unsigned-byte or unsigned-int.- Returns:
- newly created empty binary-voxels of specified size (all voxels initialized to 0).
- Throws:
CreateException
- if an unsupported data-type is requested.
-
reuseByte
LikereuseByte(org.anchoranalysis.image.voxel.Voxels<org.anchoranalysis.image.voxel.buffer.primitive.UnsignedByteBuffer>)
but uses default binary-values for off (0) and on (255).- Parameters:
voxels
- voxel-buffer to treat as binary (and internally reused).- Returns:
- newly created binary-voxels reusing existing voxels internally.
-
reuseByte
public static BinaryVoxels<UnsignedByteBuffer> reuseByte(Voxels<UnsignedByteBuffer> voxels, BinaryValuesInt binaryValues) Reuses an existing voxel-buffer (of type unsigned byte) as a binary-version which should have only two intensity-values representing off and on.No check occurs that only these intensity values exist.
- Parameters:
voxels
- voxel-buffer to treat as binary (and internally reused).binaryValues
- how to interpret off and on states.- Returns:
- newly created binary-voxels reusing existing voxels internally.
-
reuseInt
public static BinaryVoxels<UnsignedIntBuffer> reuseInt(Voxels<UnsignedIntBuffer> voxels, BinaryValuesInt binaryValues) Reuses an existing voxel-buffer (of type unsigned int) as a binary-version which should have only two intensity-values representing off and on.No check occurs that only these intensity values exist.
- Parameters:
voxels
- voxel-buffer to treat as binary (and internally reused).binaryValues
- how to interpret off and on states.- Returns:
- newly created binary-voxels reusing existing voxels internally.
-