T
- buffer-typepublic abstract class Voxels<T> extends Object
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.
Modifier and Type | Field and Description |
---|---|
static Extent |
MAX_IN_TO_STRING
The maximum number of rows/columns/slices to show in
toString() . |
Constructor and Description |
---|
Voxels(SliceBufferIndex<T> slices,
VoxelsFactoryTypeBound<T> factory,
VoxelsArithmetic arithmetic) |
Modifier and Type | Method and Description |
---|---|
VoxelsArithmetic |
arithmetic()
Interface 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.
|
VoxelDataType |
dataType()
The underlying data-type of the voxels, represented by a
VoxelDataType instance. |
Voxels<T> |
duplicate()
A deep-copy.
|
boolean |
equalsDeep(Voxels<?> other)
Are the voxels identical to another voxels (deep equals)?
|
Extent |
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.
|
VoxelsFactoryTypeBound<T> |
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.
|
VoxelBuffer<T> |
slice(int z)
A
VoxelBuffer corresponding to a particular z-slice. |
T |
sliceBuffer(int z)
A buffer corresponding to a particular z-slice.
|
SliceBufferIndex<T> |
slices()
An index mapping slice of voxels (in the z dimension) to a particular buffer with the
corresponding voxel intensities.
|
String |
toString()
Print a description and the the first
MAX_IN_TO_STRING (if they exist) rows and columns as values. |
public static final Extent MAX_IN_TO_STRING
toString()
.public Voxels(SliceBufferIndex<T> slices, VoxelsFactoryTypeBound<T> factory, VoxelsArithmetic arithmetic)
public abstract VoxelsExtracter<T> extract()
public abstract VoxelsAssigner assignValue(int valueToAssign)
valueToAssign
- the value to assign.public VoxelDataType dataType()
VoxelDataType
instance.VoxelDataType
.public VoxelBuffer<T> slice(int z)
VoxelBuffer
corresponding to a particular z-slice.z
- the index (beginning at 0) of the respective z-slice.z
.public T sliceBuffer(int z)
This buffer is either a NIO class or another class that wraps the underlying array storing voxel intensities.
z
- the index (beginning at 0) of the respective z-slice.z
.public Extent extent()
public boolean equalsDeep(Voxels<?> other)
other
- the other voxels to compare with.public void replaceSlice(int sliceIndexToUpdate, VoxelBuffer<T> bufferToAssign)
This is a mutable operation.
sliceIndexToUpdate
- slice-index to update.bufferToAssign
- buffer to assign.public String toString()
MAX_IN_TO_STRING
(if they exist) rows and columns as values.public SliceBufferIndex<T> slices()
public VoxelsFactoryTypeBound<T> factory()
public VoxelsArithmetic arithmetic()
Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.