Package org.anchoranalysis.image.voxel
Class Voxels<T>
Object
Voxels<T>
- Type Parameters:
T
- buffer-type
- Direct Known Subclasses:
VoxelsFloat
,VoxelsUnsignedByte
,VoxelsUnsignedInt
,VoxelsUnsignedShort
A box (3-dimensions) with voxel-data.
This class is almost immutable, with the exception of the buffers containing intensity values which can be modified.
All operations that can modify the state (i.e. mutable operations) are provided via the
assignValue(int)
or arithmetic()
or replaceSlice(int, org.anchoranalysis.image.voxel.buffer.VoxelBuffer<T>)
or slice(int)
or
sliceBuffer(int)
methods. Other operations are all immutable.
See VoxelsUntyped
for a similar class that exposes the voxel-data type as a run-time
accessible field.
- Author:
- Owen Feehan
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Extent
The maximum number of rows/columns/slices to show intoString()
. -
Constructor Summary
ConstructorsConstructorDescriptionVoxels
(SliceBufferIndex<T> slices, VoxelsFactoryTypeBound<T> factory, VoxelsArithmetic arithmetic) Creates a newVoxels
instance. -
Method Summary
Modifier and TypeMethodDescriptionInterface that allows manipulation of voxel intensities via arithmetic operations.abstract VoxelsAssigner
assignValue
(int valueToAssign) Interface that allows assignment of a particular value to all or subsets of the voxels.dataType()
The underlying data-type of the voxels, represented by aVoxelDataType
instance.A deep-copy.boolean
equalsDeep
(Voxels<?> other) Are the voxels identical to another voxels (deep equals)?extent()
The size of the voxels across three dimensions.abstract VoxelsExtracter
<T> extract()
Interface that allows read/copy/duplication operations to be performed regarding the voxels intensities.factory()
A factory for creating voxels with a particular buffer-type.void
replaceSlice
(int sliceIndexToUpdate, VoxelBuffer<T> bufferToAssign) Assigns a new buffer for a particular slice.slice
(int z) AVoxelBuffer
corresponding to a particular z-slice.sliceBuffer
(int z) A buffer corresponding to a particular z-slice.slices()
An index mapping slice of voxels (in the z dimension) to a particular buffer with the corresponding voxel intensities.toString()
Print a description and the the firstMAX_IN_TO_STRING
(if they exist) rows and columns as values.
-
Field Details
-
MAX_IN_TO_STRING
The maximum number of rows/columns/slices to show intoString()
.
-
-
Constructor Details
-
Voxels
public Voxels(SliceBufferIndex<T> slices, VoxelsFactoryTypeBound<T> factory, VoxelsArithmetic arithmetic) Creates a newVoxels
instance.- Parameters:
slices
- An index mapping slice of voxels (in the z dimension) to a particular buffer with the corresponding voxel intensities.factory
- A factory for creating voxels with a particular buffer-type.arithmetic
- Interface that allows manipulation of voxel intensities via arithmetic operations.
-
-
Method Details
-
extract
Interface that allows read/copy/duplication operations to be performed regarding the voxels intensities.- Returns:
- the interface.
-
assignValue
Interface that allows assignment of a particular value to all or subsets of the voxels.- Parameters:
valueToAssign
- the value to assign.- Returns:
- the interface.
-
dataType
The underlying data-type of the voxels, represented by aVoxelDataType
instance.- Returns:
- an instance of
VoxelDataType
.
-
slice
AVoxelBuffer
corresponding to a particular z-slice.- Parameters:
z
- the index (beginning at 0) of the respective z-slice.- Returns:
- the corresponding buffer for
z
.
-
sliceBuffer
A buffer corresponding to a particular z-slice.This buffer is either a NIO class or another class that wraps the underlying array storing voxel intensities.
- Parameters:
z
- the index (beginning at 0) of the respective z-slice.- Returns:
- the corresponding buffer for
z
.
-
extent
The size of the voxels across three dimensions.- Returns:
- the size.
-
duplicate
A deep-copy.- Returns:
- newly created deep-copy.
-
equalsDeep
Are the voxels identical to another voxels (deep equals)?- Parameters:
other
- the other voxels to compare with.- Returns:
- true if the size, data-type and each voxel-value of both are identical.
-
replaceSlice
Assigns a new buffer for a particular slice.This is a mutable operation.
- Parameters:
sliceIndexToUpdate
- slice-index to update.bufferToAssign
- buffer to assign.
-
toString
Print a description and the the firstMAX_IN_TO_STRING
(if they exist) rows and columns as values. -
slices
An index mapping slice of voxels (in the z dimension) to a particular buffer with the corresponding voxel intensities. -
factory
A factory for creating voxels with a particular buffer-type. -
arithmetic
Interface that allows manipulation of voxel intensities via arithmetic operations.
-