Class VoxelsResizer

Object
VoxelsResizer
Direct Known Subclasses:
VoxelsResizerExecutionTime, VoxelsResizerImageJ, VoxelsResizerImgLib2, VoxelsResizerNone, VoxelsResizerOpenCV

public abstract class VoxelsResizer extends Object
Copies voxels while performing interpolation.
Author:
Owen Feehan
  • Constructor Details

    • VoxelsResizer

      public VoxelsResizer()
  • Method Details

    • resize

      public void resize(VoxelsUntyped source, VoxelsUntyped destination)
      Copies voxels slice-by-slice from source to destination performing necessary interpolation.

      Note that interpolation only occurs in the XY plane, and the number of Z-slices should be identical for both source and destination.

      Parameters:
      source - the voxels to copy from.
      destination - the voxels to copy interpolated-values into, which may differ in size in the XY dimensions.
    • canValueRangeChange

      public abstract boolean canValueRangeChange()
      Returns true if it's possible for values to be created after interpolation that aren't found in the input-image.
      Returns:
      true if values can be created in the destination buffer that were not found in the source buffer.
    • resizeByte

      protected abstract VoxelBuffer<UnsignedByteBuffer> resizeByte(VoxelBuffer<UnsignedByteBuffer> voxelsSource, VoxelBuffer<UnsignedByteBuffer> voxelsDestination, Extent extentSource, Extent extentDestination)
      Interpolates from voxelsSource to voxelsDestination for unsigned 8-bit buffers.

      Both buffers must be 2-dimensional, not 3-dimensional.

      Parameters:
      voxelsSource - voxels to interpolate from.
      voxelsDestination - voxels to write the interpolated values into.
      extentSource - extent corresponding to voxelsSource.
      extentDestination - extent corresponding to extentDestination.
      Returns:
      the destination buffer (either as passed, or a new one that was created).
    • resizeShort

      protected abstract VoxelBuffer<UnsignedShortBuffer> resizeShort(VoxelBuffer<UnsignedShortBuffer> voxelsSource, VoxelBuffer<UnsignedShortBuffer> voxelsDestination, Extent extentSource, Extent extentDestination)
      Interpolates from voxelsSource to voxelsDestination for unsigned 16-bit buffers.

      Both buffers must be 2-dimensional, not 3-dimensional.

      Parameters:
      voxelsSource - voxels to interpolate from.
      voxelsDestination - voxels to write the interpolated values into.
      extentSource - extent corresponding to voxelsSource.
      extentDestination - extent corresponding to extentDestination.
      Returns:
      the destination buffer (either as passed, or a new one that was created).
    • resizeFloat

      protected abstract VoxelBuffer<FloatBuffer> resizeFloat(VoxelBuffer<FloatBuffer> voxelsSource, VoxelBuffer<FloatBuffer> voxelsDestination, Extent extentSource, Extent extentDestination)
      Interpolates from voxelsSource to voxelsDestination for float buffers.

      Both buffers must be 2-dimensional, not 3-dimensional.

      Parameters:
      voxelsSource - voxels to interpolate from.
      voxelsDestination - voxels to write the interpolated values into.
      extentSource - extent corresponding to voxelsSource.
      extentDestination - extent corresponding to extentDestination.
      Returns:
      the destination buffer (either as passed, or a new one that was created).