Class IfVoxelZero
- All Implemented Interfaces:
Provider<Channel>,ProviderAsStack
Creates a new channel which is a merged version of two input channels according to rules.
- If the voxel in
channelis non-zero, then the corresponding output ischannel. - If the voxel in
channelis zero, then the corresponding output ischannelIfVoxelZero.
The two channels must be the same size.
Neither channel's input is changed. The operation is immutable.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateFromChannel(Channel channel) Creates aChannelgiven the entity provided by the delegate.If a pixel is zero in the input-channel, the output is formed from the corresponding pixel in this channel insteadstatic ChannelmergeViaZeroCheck(Channel channel, Channel channelIfPixelZero, VoxelDataType combinedType, double multiplierIfNonZero) Creates a new channel which is a merged version of two input channels according to rules.voidsetChannelIfVoxelZero(ChannelProvider channelIfVoxelZero) If a pixel is zero in the input-channel, the output is formed from the corresponding pixel in this channel insteadMethods 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
-
IfVoxelZero
public IfVoxelZero()
-
-
Method Details
-
createFromChannel
Description copied from class:ChannelProviderUnaryCreates aChannelgiven the entity provided by the delegate.- Specified by:
createFromChannelin classChannelProviderUnary- Parameters:
channel- the entity provided by the delegate.- Returns:
- the created
Channelthat is returned by the provider. - Throws:
ProvisionFailedException- if the provider cannot complete successfully.
-
mergeViaZeroCheck
public static Channel mergeViaZeroCheck(Channel channel, Channel channelIfPixelZero, VoxelDataType combinedType, double multiplierIfNonZero) Creates a new channel which is a merged version of two input channels according to rules.- If the pixel in
channelis non-zero, then the corresponding output ischannel * multFactorIfNonZero - If the pixel in
channelis zero, then the corresponding output ischannelIfPixelZero
Assumes the two channels are of the same size, but does not check.
Neither channel's input is changed. The operation is immutable.
- Parameters:
channel- the channel that is checked to be zero/non-zero, and whose pixels form the output (maybe multipled) if non-zero.channelIfPixelZero- the channel that forms the output ifchannelis zero.combinedType- the type to use for the newly created channel.multiplierIfNonZero- the multiplier to apply on non-zero pixels.- Returns:
- a newly created merged channel according to the above rules.
- If the pixel in
-
getChannelIfVoxelZero
If a pixel is zero in the input-channel, the output is formed from the corresponding pixel in this channel instead -
setChannelIfVoxelZero
If a pixel is zero in the input-channel, the output is formed from the corresponding pixel in this channel instead
-