public class VoxelsResizerOpenCV extends VoxelsResizer
VoxelBuffer
s using OpenCV's cv2.resize
function.
It uses Imgproc.INTER_AREA
interpolation when downsampling, and Imgproc.INTER_LINEAR
when upsampling.
Constructor and Description |
---|
VoxelsResizerOpenCV() |
Modifier and Type | Method and Description |
---|---|
boolean |
canValueRangeChange()
Returns true if it's possible for values to be created after interpolation that aren't found
in the input-image.
|
protected VoxelBuffer<UnsignedByteBuffer> |
resizeByte(VoxelBuffer<UnsignedByteBuffer> voxelsSource,
VoxelBuffer<UnsignedByteBuffer> voxelsDestination,
Extent extentSource,
Extent extentDestination)
Interpolates from
voxelsSource to voxelsDestination for unsigned 8-bit
buffers. |
protected VoxelBuffer<FloatBuffer> |
resizeFloat(VoxelBuffer<FloatBuffer> voxelsSource,
VoxelBuffer<FloatBuffer> voxelsDestination,
Extent extentSource,
Extent extentDestination)
Interpolates from
voxelsSource to voxelsDestination for float buffers. |
protected VoxelBuffer<UnsignedShortBuffer> |
resizeShort(VoxelBuffer<UnsignedShortBuffer> voxelsSource,
VoxelBuffer<UnsignedShortBuffer> voxelsDestination,
Extent extentSource,
Extent extentDestination)
Interpolates from
voxelsSource to voxelsDestination for unsigned 16-bit
buffers. |
resize
public boolean canValueRangeChange()
VoxelsResizer
canValueRangeChange
in class VoxelsResizer
protected VoxelBuffer<UnsignedByteBuffer> resizeByte(VoxelBuffer<UnsignedByteBuffer> voxelsSource, VoxelBuffer<UnsignedByteBuffer> voxelsDestination, Extent extentSource, Extent extentDestination)
VoxelsResizer
voxelsSource
to voxelsDestination
for unsigned 8-bit
buffers.
Both buffers must be 2-dimensional, not 3-dimensional.
resizeByte
in class VoxelsResizer
voxelsSource
- voxels to interpolate from.voxelsDestination
- voxels to write the interpolated values into.extentSource
- extent corresponding to voxelsSource
.extentDestination
- extent corresponding to extentDestination
.protected VoxelBuffer<UnsignedShortBuffer> resizeShort(VoxelBuffer<UnsignedShortBuffer> voxelsSource, VoxelBuffer<UnsignedShortBuffer> voxelsDestination, Extent extentSource, Extent extentDestination)
VoxelsResizer
voxelsSource
to voxelsDestination
for unsigned 16-bit
buffers.
Both buffers must be 2-dimensional, not 3-dimensional.
resizeShort
in class VoxelsResizer
voxelsSource
- voxels to interpolate from.voxelsDestination
- voxels to write the interpolated values into.extentSource
- extent corresponding to voxelsSource
.extentDestination
- extent corresponding to extentDestination
.protected VoxelBuffer<FloatBuffer> resizeFloat(VoxelBuffer<FloatBuffer> voxelsSource, VoxelBuffer<FloatBuffer> voxelsDestination, Extent extentSource, Extent extentDestination)
VoxelsResizer
voxelsSource
to voxelsDestination
for float buffers.
Both buffers must be 2-dimensional, not 3-dimensional.
resizeFloat
in class VoxelsResizer
voxelsSource
- voxels to interpolate from.voxelsDestination
- voxels to write the interpolated values into.extentSource
- extent corresponding to voxelsSource
.extentDestination
- extent corresponding to extentDestination
.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.