Class VoxelsResizerImgLib2
Object
VoxelsResizer
VoxelsResizerImgLib2
- Direct Known Subclasses:
Lanczos
,Linear
,NearestNeighbor
Performs resizing of
VoxelBuffer
s using ImgLib2's interpolation.
By default, voxels at the boundaries are mirrored (i.e. voxels just after the boundary are treated like the closest voxel inside the boundary), but this can be changed to an extent strategy instead.
- Author:
- Owen Feehan
-
Constructor Summary
ConstructorsConstructorDescriptionVoxelsResizerImgLib2
(net.imglib2.interpolation.InterpolatorFactory<net.imglib2.type.numeric.integer.UnsignedByteType, net.imglib2.RandomAccessible<net.imglib2.type.numeric.integer.UnsignedByteType>> factoryByte, net.imglib2.interpolation.InterpolatorFactory<net.imglib2.type.numeric.integer.UnsignedShortType, net.imglib2.RandomAccessible<net.imglib2.type.numeric.integer.UnsignedShortType>> factoryShort, net.imglib2.interpolation.InterpolatorFactory<net.imglib2.type.numeric.real.FloatType, net.imglib2.RandomAccessible<net.imglib2.type.numeric.real.FloatType>> factoryFloat) -
Method Summary
Modifier and TypeMethodDescriptionvoid
extendWith
(int extendValue) Switches to extend constant-value out-of-bounds strategyresizeByte
(VoxelBuffer<UnsignedByteBuffer> voxelsSource, VoxelBuffer<UnsignedByteBuffer> voxelsDestination, Extent extentSource, Extent extentDestination) Interpolates fromvoxelsSource
tovoxelsDestination
for unsigned 8-bit buffers.resizeFloat
(VoxelBuffer<FloatBuffer> voxelsSource, VoxelBuffer<FloatBuffer> voxelsDestination, Extent extentSource, Extent extentDestination) Interpolates fromvoxelsSource
tovoxelsDestination
for float buffers.resizeShort
(VoxelBuffer<UnsignedShortBuffer> voxelsSource, VoxelBuffer<UnsignedShortBuffer> voxelsDestination, Extent extentSource, Extent extentDestination) Interpolates fromvoxelsSource
tovoxelsDestination
for unsigned 16-bit buffers.Methods inherited from class org.anchoranalysis.image.voxel.resizer.VoxelsResizer
canValueRangeChange, resize
-
Constructor Details
-
VoxelsResizerImgLib2
public VoxelsResizerImgLib2(net.imglib2.interpolation.InterpolatorFactory<net.imglib2.type.numeric.integer.UnsignedByteType, net.imglib2.RandomAccessible<net.imglib2.type.numeric.integer.UnsignedByteType>> factoryByte, net.imglib2.interpolation.InterpolatorFactory<net.imglib2.type.numeric.integer.UnsignedShortType, net.imglib2.RandomAccessible<net.imglib2.type.numeric.integer.UnsignedShortType>> factoryShort, net.imglib2.interpolation.InterpolatorFactory<net.imglib2.type.numeric.real.FloatType, net.imglib2.RandomAccessible<net.imglib2.type.numeric.real.FloatType>> factoryFloat)
-
-
Method Details
-
resizeByte
public VoxelBuffer<UnsignedByteBuffer> resizeByte(VoxelBuffer<UnsignedByteBuffer> voxelsSource, VoxelBuffer<UnsignedByteBuffer> voxelsDestination, Extent extentSource, Extent extentDestination) Description copied from class:VoxelsResizer
Interpolates fromvoxelsSource
tovoxelsDestination
for unsigned 8-bit buffers.Both buffers must be 2-dimensional, not 3-dimensional.
- Specified by:
resizeByte
in classVoxelsResizer
- Parameters:
voxelsSource
- voxels to interpolate from.voxelsDestination
- voxels to write the interpolated values into.extentSource
- extent corresponding tovoxelsSource
.extentDestination
- extent corresponding toextentDestination
.- Returns:
- the destination buffer (either as passed, or a new one that was created).
-
resizeShort
public VoxelBuffer<UnsignedShortBuffer> resizeShort(VoxelBuffer<UnsignedShortBuffer> voxelsSource, VoxelBuffer<UnsignedShortBuffer> voxelsDestination, Extent extentSource, Extent extentDestination) Description copied from class:VoxelsResizer
Interpolates fromvoxelsSource
tovoxelsDestination
for unsigned 16-bit buffers.Both buffers must be 2-dimensional, not 3-dimensional.
- Specified by:
resizeShort
in classVoxelsResizer
- Parameters:
voxelsSource
- voxels to interpolate from.voxelsDestination
- voxels to write the interpolated values into.extentSource
- extent corresponding tovoxelsSource
.extentDestination
- extent corresponding toextentDestination
.- Returns:
- the destination buffer (either as passed, or a new one that was created).
-
resizeFloat
public VoxelBuffer<FloatBuffer> resizeFloat(VoxelBuffer<FloatBuffer> voxelsSource, VoxelBuffer<FloatBuffer> voxelsDestination, Extent extentSource, Extent extentDestination) Description copied from class:VoxelsResizer
Interpolates fromvoxelsSource
tovoxelsDestination
for float buffers.Both buffers must be 2-dimensional, not 3-dimensional.
- Specified by:
resizeFloat
in classVoxelsResizer
- Parameters:
voxelsSource
- voxels to interpolate from.voxelsDestination
- voxels to write the interpolated values into.extentSource
- extent corresponding tovoxelsSource
.extentDestination
- extent corresponding toextentDestination
.- Returns:
- the destination buffer (either as passed, or a new one that was created).
-
extendWith
public void extendWith(int extendValue) Switches to extend constant-value out-of-bounds strategy- Parameters:
extendValue
- constant-value to use for all values outside the boundary
-