T
- buffer-type.public final class SlidingBuffer<T> extends Object
It can slide along the z-dimension of Voxels
tracking the current z-slice's
buffer and neighboring buffers.
Specifically, three buffers are always tracked:
Can then be shifted (incremented) across all z-slices.
The shift()
or seek(int)
operations can be used to shift the buffer to focus on a
particular z-slice.
Constructor and Description |
---|
SlidingBuffer(Voxels<T> voxels)
Create for particular voxels.
|
Modifier and Type | Method and Description |
---|---|
VoxelBuffer<T> |
bufferRelative(int relativeIndex)
Returns the corresponding buffer at a relative z-slice index to the current focused z-slice.
|
Extent |
extent()
The size of the voxels across three dimensions.
|
VoxelBuffer<T> |
getCenter()
The buffer for the currently selected slice.
|
VoxelBuffer<T> |
getMinusOne()
The voxel-buffer for the slice with the currently selected slice's index
-1 or null
if it's the first slice. |
VoxelBuffer<T> |
getPlusOne()
The voxel-buffer for the slice with the currently selected slice's index
+1 or null
if it's the final slice. |
Voxels<T> |
getVoxels()
The voxels from which buffers corresponding to slices are extracted.
|
void |
seek(int sliceIndexToSeek)
Moves buffer to a particular z-slice.
|
void |
shift()
Increments the slice number by one.
|
public void seek(int sliceIndexToSeek)
sliceIndexToSeek
- the index of the z-slice to move to.public void shift()
public VoxelBuffer<T> bufferRelative(int relativeIndex)
relativeIndex
- an index relative to the current focus's z-slice e.g. -1 or 0 or 1public Extent extent()
Note this is not the size of an individual z-slice, but rather the size of all voxels.
public Voxels<T> getVoxels()
public VoxelBuffer<T> getCenter()
public VoxelBuffer<T> getPlusOne()
+1
or null
if it's the final slice.public VoxelBuffer<T> getMinusOne()
-1
or null
if it's the first slice.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.