Interface VoxelsExtracter<T>
- Type Parameters:
T
- buffer-type
- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionvoid
boxCopyTo
(BoundingBox from, Voxels<T> voxelsDestination, BoundingBox destinationBox) Copies a bounding-box area to anotherVoxels
.void
objectCopyTo
(ObjectMask from, Voxels<T> voxelsDestination, BoundingBox destinationBox) Copies an area corresponding to an object-mask to anotherVoxels
.A maximum intensity projection of all slicesA mean intensity projection of all slices.region
(BoundingBox box, boolean reuseIfPossible) A (sub-)region of the voxels.resizedXY
(int sizeX, int sizeY, VoxelsResizer resizer) Creates a new voxels that are a resized version of the current voxels (only in X and Y dimensions), interpolating as needed.slice
(int sliceIndex) Creates a newVoxels
with only particular slice.default int
voxel
(int x, int y) Gets the value of one particular voxel.default int
voxel
(int x, int y, int z) Gets the value of one particular voxel.int
voxel
(ReadableTuple3i point) Gets the value of one particular voxel.voxelsEqualTo
(int equalToValue) Operations on whether particular voxels are equal to a particular value.voxelsGreaterThan
(int threshold) Operations on whether particular voxels are greater than a threshold (but not equal to).Finds the minimum-value and maximum of any voxel.long
Finds the maximum-value of any voxel and rounding up (ceiling) to the nearest long.long
Finds the minimum-value of any voxel and rounding down (floor) to the nearest long.
-
Method Details
-
voxel
default int voxel(int x, int y) Gets the value of one particular voxel.Note that this provides very slow access, compared to iterating through slice buffers, so use sparingly.
The Z-coordinate is assumed to be 0.
- Parameters:
x
- coordinate of voxel in X-dimension.y
- coordinate of voxel in Y-dimension.- Returns:
- the value of a voxel (converted into an
int
).
-
voxel
default int voxel(int x, int y, int z) Gets the value of one particular voxel.Note that this provides very slow access, compared to iterating through slice buffers, so use sparingly.
- Parameters:
x
- coordinate of voxel in X-dimension.y
- coordinate of voxel in Y-dimension.z
- coordinate of voxel in Z-dimension.- Returns:
- the value of a voxel (converted into an
int
).
-
voxel
Gets the value of one particular voxel.Note that this provides very slow access, compared to iterating through slice buffers, so use sparingly.
- Parameters:
point
- coordinates.- Returns:
- the value of a voxel (converted into an
int
).
-
slice
Creates a newVoxels
with only particular slice.This is an immutable operation.
- Parameters:
sliceIndex
- index of slice in z-dimension.- Returns:
- a channel containing the slice (reusing the existing voxel buffers).
-
region
A (sub-)region of the voxels.The region may some smaller portion of the voxels, or the voxels in their entirety.
It should never be larger than the voxels.
Depending on policy, an the existing box will be reused if possible (if the region requested is equal to the box as a whole), useful to avoid unnecessary new memory allocation.
If
reuseIfPossible
is false, it is guaranteed that a new voxels will always be created.- Parameters:
box
- a bounding-box indicating the regions desired (not be larger than the extent)reuseIfPossible
- if true the existing box will be reused if possible,, otherwise a new box is always created.- Returns:
- voxels corresponding to the requested region, either newly-created or reused
-
boxCopyTo
Copies a bounding-box area to anotherVoxels
.from
anddestinationBox
must have identically-sizedExtent
s.- Parameters:
from
- box to copy from (relative to the current voxels).voxelsDestination
- where to copy into.destinationBox
- box to copy into (relative tovoxelsDestination
).
-
objectCopyTo
Copies an area corresponding to an object-mask to anotherVoxels
.Only copies voxels if part of an object, otherwise voxels in the destination-buffer are not changed.
from
's bounding-box anddestinationBox
must have identically-sizedExtent
s.- Parameters:
from
- only copies voxels which correspond to an on voxels in the object-mask.voxelsDestination
- where to copy into.destinationBox
- box to copy into (relative tovoxelsDestination
).
-
resizedXY
Creates a new voxels that are a resized version of the current voxels (only in X and Y dimensions), interpolating as needed.This is an immutable operation.
- Parameters:
sizeX
- new size in X dimension.sizeY
- new size in Y dimension.resizer
- an interpolator for resizing voxels.- Returns:
- newly created voxels of specified size containing interpolated voxels from the current voxels.
-
projectMax
A maximum intensity projection of all slices- Returns:
- voxels with newly-created buffers containing projection (identical in XY dimensions but with a single slice).
-
projectMean
A mean intensity projection of all slices.- Returns:
- voxels with newly-created buffers containing projection (identical in XY dimensions but with a single slice).
-
voxelsEqualTo
Operations on whether particular voxels are equal to a particular value.- Parameters:
equalToValue
-- Returns:
- a newly instantiated object to perform queries on voxels who fulfill the above condition.
-
voxelsGreaterThan
Operations on whether particular voxels are greater than a threshold (but not equal to).- Parameters:
threshold
- voxel-values greater than this threshold are included.- Returns:
- a newly instantiated object to perform queries on voxels who fulfill the above condition.
-
voxelWithMinIntensity
long voxelWithMinIntensity()Finds the minimum-value of any voxel and rounding down (floor) to the nearest long.The computational cost of the operation is
O(n)
in the number of voxels. The result is not cached.- Returns:
- the minimum-value.
-
voxelWithMaxIntensity
long voxelWithMaxIntensity()Finds the maximum-value of any voxel and rounding up (ceiling) to the nearest long.The computational cost of the operation is
O(n)
in the number of voxels. The result is not cached.- Returns:
- the maximum-value.
-
voxelsWithMinMaxIntensity
MinMaxRange voxelsWithMinMaxIntensity()Finds the minimum-value and maximum of any voxel.The minimum is rounded down (floor) to the nearest long.
The maximum is rounded up (ceil) to the nearest long.
This is efficient than calling
voxelWithMinIntensity()
andvoxelWithMaxIntensity()
separately.The computational cost of the operation is
O(n)
in the number of voxels. The result is not cached.- Returns:
- the minimum- and maximum values.
-