public class BufferedImageFromStack extends Object
Stack
or similar data-objects into an AWT BufferedImage
.
Please see BufferedImageFromVoxels
to convert from a Voxels
instance.
Modifier and Type | Method and Description |
---|---|
static BufferedImage |
create(Stack stack)
Creates a
BufferedImage from a Stack . |
static BufferedImage |
createRGB(Voxels<UnsignedByteBuffer> red,
Voxels<UnsignedByteBuffer> green,
Voxels<UnsignedByteBuffer> blue,
Extent extent)
Creates a
BufferedImage from three Voxels<UnsignedByteBuffer> representing
respectively, red, green, blue color components. |
public static BufferedImage create(Stack stack) throws CreateException
BufferedImage
from a Stack
.
The following situations are supported with the Stack
:
UnsignedByteVoxelType
, representing the colors red,
green, blue respectively.
UnsignedByteVoxelType
.
UnsignedShortVoxelType
.
stack
- the stack.BufferedImage
.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.public static BufferedImage createRGB(Voxels<UnsignedByteBuffer> red, Voxels<UnsignedByteBuffer> green, Voxels<UnsignedByteBuffer> blue, Extent extent) throws CreateException
BufferedImage
from three Voxels<UnsignedByteBuffer>
representing
respectively, red, green, blue color components.
All three Voxels
must be sized exactly as extent
.
red
- the voxels describing the red color component.green
- the voxels describing the green color component.blue
- the voxels describing the blue color component.extent
- the size of the BufferedImage
to create.BufferedImage
that reuses the underlying array in the
buffer of voxels
.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.Copyright © 2010–2023 Owen Feehan, ETH Zurich, University of Zurich, Hoffmann-La Roche. All rights reserved.