Class BufferedImageFromVoxels

Object
BufferedImageFromVoxels

public class BufferedImageFromVoxels extends Object
Converts a Voxels instance into an AWT BufferedImage.
Author:
Owen Feehan
  • Method Details

    • createGrayscaleByte

      public static BufferedImage createGrayscaleByte(Voxels<UnsignedByteBuffer> voxels) throws CreateException
      Creates a BufferedImage from a Voxels<UnsignedByteBuffer>.
      Parameters:
      voxels - the voxels.
      Returns:
      a newly created 8-bit BufferedImage that reuses the underlying array in the buffer of voxels.
      Throws:
      CreateException - if the stack does not conform to a supported data-type or number of channels or if the stack is 3D which is unsupported.
    • createGrayscaleShort

      public static BufferedImage createGrayscaleShort(Voxels<UnsignedShortBuffer> voxels) throws CreateException
      Creates a BufferedImage from a Voxels<UnsignedShortBuffer>.
      Parameters:
      voxels - the voxels.
      Returns:
      a newly created 16-bit BufferedImage that reuses the underlying array in the buffer of voxels.
      Throws:
      CreateException - if the stack does not conform to a supported data-type or number of channels or if the stack is 3D which is unsupported.