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
channel
is non-zero, then the corresponding output ischannel
. - If the voxel in
channel
is 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 aChannel
given 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 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.void
setChannelIfVoxelZero
(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, 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
-
IfVoxelZero
public IfVoxelZero()
-
-
Method Details
-
createFromChannel
Description copied from class:ChannelProviderUnary
Creates aChannel
given the entity provided by the delegate.- Specified by:
createFromChannel
in classChannelProviderUnary
- Parameters:
channel
- the entity provided by the delegate.- Returns:
- the created
Channel
that 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
channel
is non-zero, then the corresponding output ischannel * multFactorIfNonZero
- If the pixel in
channel
is 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 ifchannel
is 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
-