Class SlidingBuffer<T>
Object
SlidingBuffer<T>
- Type Parameters:
T
- buffer-type.
An index that places a particular z-slice in local context.
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:
- the buffer for the current slice.
- the current slice minus 1.
- the current slice plus 1.
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbufferRelative
(int relativeIndex) Returns the corresponding buffer at a relative z-slice index to the current focused z-slice.extent()
The size of the voxels across three dimensions.The buffer for the currently selected slice.The voxel-buffer for the slice with the currently selected slice's index-1
or null if it's the first slice.The voxel-buffer for the slice with the currently selected slice's index+1
or null if it's the final slice.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.
-
Constructor Details
-
SlidingBuffer
Create for particular voxels.- Parameters:
voxels
- the voxels to slide a buffer across the z-dimension.
-
-
Method Details
-
seek
public void seek(int sliceIndexToSeek) Moves buffer to a particular z-slice.- Parameters:
sliceIndexToSeek
- the index of the z-slice to move to.
-
shift
public void shift()Increments the slice number by one. -
bufferRelative
Returns the corresponding buffer at a relative z-slice index to the current focused z-slice.- Parameters:
relativeIndex
- an index relative to the current focus's z-slice e.g. -1 or 0 or 1- Returns:
- the corresponding buffer.
-
extent
The size of the voxels across three dimensions.Note this is not the size of an individual z-slice, but rather the size of all voxels.
- Returns:
- the size.
-
getVoxels
The voxels from which buffers corresponding to slices are extracted. -
getCenter
The buffer for the currently selected slice. -
getPlusOne
The voxel-buffer for the slice with the currently selected slice's index+1
or null if it's the final slice. -
getMinusOne
The voxel-buffer for the slice with the currently selected slice's index-1
or null if it's the first slice.
-