Class BranchChannels

Object
AnchorBean<StackWriter>
StackWriter
StackWriterDelegateBase
BranchChannels

public class BranchChannels extends StackWriterDelegateBase
Uses different raster-writers depending on the number/type of channels.

If any optional condition does not have a writer, then writer is used in this case. An exception is whenBinaryChannel, which instead falls back to whenSingleChannel if unspecified.

The order of precedence is:

  • whenNotEightBit
  • whenRGB
  • whenRGBAlpha
  • whenThreeChannels
  • whenBinaryChannel
  • whenSingleChannel
Author:
Owen Feehan
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    StackWriter
    Writer employed if a stack is a single-channeled binary image.
    StackWriter
    Writer employed if a stack contains channels that are not 8-bit.
    StackWriter
    Writer employed if a stack is a three-channeled RGB image.
    StackWriter
    Writer employed if a stack is a four-channeled RGBA image.
    StackWriter
    Writer employed if a stack is a single-channeled image, not guaranteed to be binary.
    StackWriter
    Writer employed if a stack is a three-channeled non-RGB image.
    StackWriter
    Default writer, if a more specific writer is not specified for a condition.
    protected StackWriter
    selectDelegate(StackWriteOptions writeOptions)
    Selects a StackWriter to use as a delegate.
    void
    setWhenBinaryChannel(StackWriter whenBinaryChannel)
    Writer employed if a stack is a single-channeled binary image.
    void
    setWhenNotEightBit(StackWriter whenNotEightBit)
    Writer employed if a stack contains channels that are not 8-bit.
    void
    setWhenRGB(StackWriter whenRGB)
    Writer employed if a stack is a three-channeled RGB image.
    void
    setWhenRGBAlpha(StackWriter whenRGBAlpha)
    Writer employed if a stack is a four-channeled RGBA image.
    void
    setWhenSingleChannel(StackWriter whenSingleChannel)
    Writer employed if a stack is a single-channeled image, not guaranteed to be binary.
    void
    setWhenThreeChannels(StackWriter whenThreeChannels)
    Writer employed if a stack is a three-channeled non-RGB image.
    void
    setWriter(StackWriter writer)
    Default writer, if a more specific writer is not specified for a condition.

    Methods inherited from class org.anchoranalysis.plugin.io.bean.stack.writer.StackWriterDelegateBase

    fileFormat, writeStack

    Methods inherited from class org.anchoranalysis.image.io.bean.stack.writer.StackWriter

    fileFormatWarnUnexpected, writeStackWithExtension

    Methods inherited from class org.anchoranalysis.bean.AnchorBean

    checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • BranchChannels

      public BranchChannels()
  • Method Details

    • selectDelegate

      protected StackWriter selectDelegate(StackWriteOptions writeOptions)
      Description copied from class: StackWriterDelegateBase
      Selects a StackWriter to use as a delegate.
      Specified by:
      selectDelegate in class StackWriterDelegateBase
      Parameters:
      writeOptions - options that specify what kind of rasters will be written.
      Returns:
      the selected StackWriter
    • getWriter

      public StackWriter getWriter()
      Default writer, if a more specific writer is not specified for a condition.
    • setWriter

      public void setWriter(StackWriter writer)
      Default writer, if a more specific writer is not specified for a condition.
    • getWhenNotEightBit

      public StackWriter getWhenNotEightBit()
      Writer employed if a stack contains channels that are not 8-bit.
    • setWhenNotEightBit

      public void setWhenNotEightBit(StackWriter whenNotEightBit)
      Writer employed if a stack contains channels that are not 8-bit.
    • getWhenRGB

      public StackWriter getWhenRGB()
      Writer employed if a stack is a three-channeled RGB image.
    • setWhenRGB

      public void setWhenRGB(StackWriter whenRGB)
      Writer employed if a stack is a three-channeled RGB image.
    • getWhenRGBAlpha

      public StackWriter getWhenRGBAlpha()
      Writer employed if a stack is a four-channeled RGBA image.
    • setWhenRGBAlpha

      public void setWhenRGBAlpha(StackWriter whenRGBAlpha)
      Writer employed if a stack is a four-channeled RGBA image.
    • getWhenSingleChannel

      public StackWriter getWhenSingleChannel()
      Writer employed if a stack is a single-channeled image, not guaranteed to be binary.
    • setWhenSingleChannel

      public void setWhenSingleChannel(StackWriter whenSingleChannel)
      Writer employed if a stack is a single-channeled image, not guaranteed to be binary.
    • getWhenThreeChannels

      public StackWriter getWhenThreeChannels()
      Writer employed if a stack is a three-channeled non-RGB image.
    • setWhenThreeChannels

      public void setWhenThreeChannels(StackWriter whenThreeChannels)
      Writer employed if a stack is a three-channeled non-RGB image.
    • getWhenBinaryChannel

      public StackWriter getWhenBinaryChannel()
      Writer employed if a stack is a single-channeled binary image.
    • setWhenBinaryChannel

      public void setWhenBinaryChannel(StackWriter whenBinaryChannel)
      Writer employed if a stack is a single-channeled binary image.