Class ArithmeticWithConstantConditionallyWriteBase
Object
AnchorBean<ChannelProvider>
InitializableBean<ChannelProvider,ImageInitialization>
ImageBean<ChannelProvider>
BeanProviderAsStackBase<ChannelProvider,Channel>
ChannelProvider
ChannelProviderUnary
UnaryWithValueBase
ArithmeticWithConstantConditionallyWriteBase
- All Implemented Interfaces:
Provider<Channel>
,ProviderAsStack
- Direct Known Subclasses:
MaxWithConstant
,MinWithConstant
Base class for arithmetic operations that conditionally overwrite voxel values with a constant.
This class extends UnaryWithValueBase
to provide a framework for operations that
selectively replace voxel values with a constant based on a condition.
-
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 boolean
shouldOverwriteVoxelWithConstant
(int voxel, int constant) Determines whether to overwrite the current voxel value with the constant.Methods inherited from class org.anchoranalysis.plugin.image.bean.channel.provider.UnaryWithValueBase
createFromChannel, getValue, setValue
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
-
Constructor Details
-
ArithmeticWithConstantConditionallyWriteBase
public ArithmeticWithConstantConditionallyWriteBase()
-
-
Method Details
-
createFromChannelWithConstant
public Channel createFromChannelWithConstant(Channel channel, double value) throws ProvisionFailedException Description copied from class:UnaryWithValueBase
Creates a new channel from an existing channel and a scalar value.- Specified by:
createFromChannelWithConstant
in classUnaryWithValueBase
- Parameters:
channel
- the inputChannel
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
-
shouldOverwriteVoxelWithConstant
protected abstract boolean shouldOverwriteVoxelWithConstant(int voxel, int constant) Determines whether to overwrite the current voxel value with the constant.- Parameters:
voxel
- the current voxel valueconstant
- the constant value to potentially overwrite with- Returns:
- true if the voxel should be overwritten, false otherwise
-