Class StackDisplayer

Object
org.anchoranalysis.bean.AnchorBean<StackDisplayer>
org.anchoranalysis.image.bean.displayer.StackDisplayer
Direct Known Subclasses:
IntensityQuantiles

public abstract class StackDisplayer
extends AnchorBean<StackDisplayer>
Converts from a Channel or Stack to a DisplayStack so that it can be displayed.

Only images in two forms may be displayed:

  • a single-channeled image (grayscale) with unsigned 8-bit voxel data type
  • a RGB image with three channels, each with unsigned 8-bit voxel data type.

Any other form of image, will be converted into one of the above (the former only if there is a single-channel).

If there are more than three channels, the first three channels are taken.

If there are only two channels, they occupy respectively the red and blue channels (green is left blank).

Author:
Owen Feehan
  • Constructor Details

  • Method Details

    • deriveFrom

      public DisplayStack deriveFrom​(Channel channel) throws CreateException
      Creates from a Channel.
      Parameters:
      channel - the stack to create from.
      Returns:
      a newly created DisplayStack, after applying any applicable conversion.
      Throws:
      CreateException - if a converter cannot be associated with a particular channel.
    • deriveFrom

      public DisplayStack deriveFrom​(Stack stack) throws CreateException
      Derives a DisplayStack from a RGBStack.
      Parameters:
      stack - the stack to create from, which should have either 1 or 3 channels (corresponding to RGB).
      Returns:
      a newly created DisplayStack, after applying any applicable conversion.
      Throws:
      CreateException - with an incorrect number of channels, or if a converter cannot be associated with a particular channel.
    • deriveFrom

      public DisplayStack deriveFrom​(RGBStack rgbStack) throws CreateException
      Derives a DisplayStack from a RGBStack.
      Parameters:
      rgbStack - the stack to create from.
      Returns:
      a newly created DisplayStack, after applying any applicable conversion.
      Throws:
      CreateException - if a converter cannot be associated with a particular channel.
    • createConverterFor

      protected abstract ChannelConverterAttached<Channel,​org.anchoranalysis.image.voxel.buffer.primitive.UnsignedByteBuffer> createConverterFor​(org.anchoranalysis.image.voxel.datatype.VoxelDataType dataType)
      Determines what kind of converter to use for a particular channel, to map it to an unsigned 8-bit channel.
      Parameters:
      dataType - the voxel-data type that must be converted to unsigned 8-bit.
      Returns:
      a newly created ChannelConverterAttached that can convert from channels with voxel-type dataType to unsigned 8-bit.