Class UnaryWithValueBase

Object
AnchorBean<ChannelProvider>
InitializableBean<ChannelProvider, ImageInitialization>
ImageBean<ChannelProvider>
BeanProviderAsStackBase<ChannelProvider, Channel>
ChannelProvider
ChannelProviderUnary
UnaryWithValueBase
All Implemented Interfaces:
Provider<Channel>, ProviderAsStack
Direct Known Subclasses:
ArithmeticWithConstantBase, ArithmeticWithConstantConditionallyWriteBase

public abstract class UnaryWithValueBase extends ChannelProviderUnary
A ChannelProviderUnary which has a scalar value field.

This abstract class extends ChannelProviderUnary to provide a framework for creating channels based on an input channel and a scalar value. Subclasses must implement the createFromChannelWithConstant method.

  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Channel
    createFromChannel(Channel channel)
     
    protected abstract Channel
    createFromChannelWithConstant(Channel channel, double value)
    Creates a new channel from an existing channel and a scalar value.
    double
    The scalar value to be used in channel creation.
    void
    setValue(double value)
    The scalar value to be used in channel creation.

    Methods inherited from class org.anchoranalysis.image.bean.provider.ChannelProviderUnary

    get, getChannel, setChannel

    Methods inherited from class org.anchoranalysis.image.bean.provider.ChannelProvider

    getAsStack

    Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean

    getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitialization

    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

    • UnaryWithValueBase

      public UnaryWithValueBase()
  • Method Details

    • createFromChannel

      public Channel createFromChannel(Channel channel) throws ProvisionFailedException
      Specified by:
      createFromChannel in class ChannelProviderUnary
      Throws:
      ProvisionFailedException
    • createFromChannelWithConstant

      protected abstract Channel createFromChannelWithConstant(Channel channel, double value) throws ProvisionFailedException
      Creates a new channel from an existing channel and a scalar value.
      Parameters:
      channel - the input Channel
      value - the scalar value to be used in channel creation
      Returns:
      a new Channel created from the input channel and scalar value
      Throws:
      ProvisionFailedException - if the channel creation fails
    • getValue

      public double getValue()
      The scalar value to be used in channel creation.
    • setValue

      public void setValue(double value)
      The scalar value to be used in channel creation.