Class BufferedImageFromVoxels
Object
org.anchoranalysis.image.voxel.convert.bufferedimage.BufferedImageFromVoxels
public class BufferedImageFromVoxels extends Object
Converts a
Voxels instance into an AWT BufferedImage.- Author:
- Owen Feehan
-
Method Summary
Modifier and Type Method Description static BufferedImagecreateGrayscaleByte(Voxels<UnsignedByteBuffer> voxels)Creates aBufferedImagefrom aVoxels<UnsignedByteBuffer>.static BufferedImagecreateGrayscaleShort(Voxels<UnsignedShortBuffer> voxels)Creates aBufferedImagefrom aVoxels<UnsignedShortBuffer>.
-
Method Details
-
createGrayscaleByte
public static BufferedImage createGrayscaleByte(Voxels<UnsignedByteBuffer> voxels) throws CreateExceptionCreates aBufferedImagefrom aVoxels<UnsignedByteBuffer>.- Parameters:
voxels- the voxels.- Returns:
- a newly created 8-bit
BufferedImagethat reuses the underlying array in the buffer ofvoxels. - 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 CreateExceptionCreates aBufferedImagefrom aVoxels<UnsignedShortBuffer>.- Parameters:
voxels- the voxels.- Returns:
- a newly created 16-bit
BufferedImagethat reuses the underlying array in the buffer ofvoxels. - 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.
-