Class ArithmeticWithConstantBase
- All Implemented Interfaces:
Provider<Channel>,ProviderAsStack
- Direct Known Subclasses:
AddConstant,MultiplyConstant,SubtractFromConstant
Base-class for operations that perform a binary arithmetic operation with each voxel-value and a
constant.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFromChannelWithConstant(Channel channel, double value) Creates a new channel from an existing channel and a scalar value.protected abstract intperformBinaryOperation(int voxel, int constant) The binary arithmetic operation that combines the voxel-value and the constant-value.Methods inherited from class org.anchoranalysis.plugin.image.bean.channel.provider.UnaryWithValueBase
createFromChannel, getValue, setValueMethods inherited from class org.anchoranalysis.image.bean.provider.ChannelProviderUnary
get, getChannel, setChannelMethods inherited from class org.anchoranalysis.image.bean.provider.ChannelProvider
getAsStackMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized, onInitializationMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
ArithmeticWithConstantBase
public ArithmeticWithConstantBase()
-
-
Method Details
-
createFromChannelWithConstant
public Channel createFromChannelWithConstant(Channel channel, double value) throws ProvisionFailedException Description copied from class:UnaryWithValueBaseCreates a new channel from an existing channel and a scalar value.- Specified by:
createFromChannelWithConstantin classUnaryWithValueBase- Parameters:
channel- the inputChannelvalue- the scalar value to be used in channel creation- Returns:
- a new
Channelcreated from the input channel and scalar value - Throws:
ProvisionFailedException- if the channel creation fails
-
performBinaryOperation
protected abstract int performBinaryOperation(int voxel, int constant) The binary arithmetic operation that combines the voxel-value and the constant-value.- Parameters:
voxel- the value of the current voxelconstant- the constant value to be used in the operation- Returns:
- the result of the binary operation
-