Class DistanceTransform3D
Object
AnchorBean<ChannelProvider>
InitializableBean<ChannelProvider, ImageInitialization>
ImageBean<ChannelProvider>
BeanProviderAsStackBase<ChannelProvider, Channel>
ChannelProvider
FromMaskBase
DistanceTransform3D
- All Implemented Interfaces:
Provider<Channel>,ProviderAsStack
public class DistanceTransform3D
extends FromMaskBase
Euclidian Distance Transform from ImageJ that works on 2D as well as 3D z-stacks.
See Distance transform on Wikipedia.
A new channel is always created i.e. the input channel is unchanged.
The plugin uses aspect ratio (relative distance between z and xy slices) in its distance calculations.
As a simplification, when resolution is used, the XY plane is multipled by the average of the x and y dimensions.
- Author:
- Owen Feehan
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionVoxels<UnsignedByteBuffer> createDistanceMapForVoxels(BinaryVoxels<UnsignedByteBuffer> voxels, Optional<Resolution> resolution, float multiplyByZRes) Creates a distance map for binary voxels.protected ChannelcreateFromMask(Mask mask) floatA factor to multiply the distance values by.booleanIf true, multiplies the values by the x-resolution, if it exists.booleanIf true, creates a short (16-bit) output instead of byte (8-bit).booleanIf true and the z-resolution is undefined, the z dimension is ignored.booleanIf true, suppresses the z-dimension in distance calculations.voidsetApplyResolution(boolean applyResolution) If true, multiplies the values by the x-resolution, if it exists.voidsetCreateShort(boolean createShort) If true, creates a short (16-bit) output instead of byte (8-bit).voidsetIgnoreZIfNaN(boolean ignoreZIfNaN) If true and the z-resolution is undefined, the z dimension is ignored.voidsetMultiplyBy(float multiplyBy) A factor to multiply the distance values by.voidsetSuppressZ(boolean suppressZ) If true, suppresses the z-dimension in distance calculations.Methods inherited from class org.anchoranalysis.plugin.image.bean.channel.provider.mask.FromMaskBase
get, getMask, setMaskMethods 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
-
DistanceTransform3D
public DistanceTransform3D()
-
-
Method Details
-
createFromMask
protected Channel createFromMask(Mask mask) throws ProvisionFailedException - Specified by:
createFromMaskin classFromMaskBase- Throws:
ProvisionFailedException
-
createDistanceMapForVoxels
public Voxels<UnsignedByteBuffer> createDistanceMapForVoxels(BinaryVoxels<UnsignedByteBuffer> voxels, Optional<Resolution> resolution, float multiplyByZRes) throws ProvisionFailedException Creates a distance map for binary voxels.- Parameters:
voxels- the binary voxels to create a distance map forresolution- the optional resolution of the voxelsmultiplyByZRes- a factor to multiply the z-resolution by- Returns:
- the distance map as
VoxelsofUnsignedByteBuffer - Throws:
ProvisionFailedException- if the distance map creation fails
-
isSuppressZ
public boolean isSuppressZ()If true, suppresses the z-dimension in distance calculations. -
setSuppressZ
public void setSuppressZ(boolean suppressZ) If true, suppresses the z-dimension in distance calculations. -
getMultiplyBy
public float getMultiplyBy()A factor to multiply the distance values by. -
setMultiplyBy
public void setMultiplyBy(float multiplyBy) A factor to multiply the distance values by. -
isCreateShort
public boolean isCreateShort()If true, creates a short (16-bit) output instead of byte (8-bit). -
setCreateShort
public void setCreateShort(boolean createShort) If true, creates a short (16-bit) output instead of byte (8-bit). -
isApplyResolution
public boolean isApplyResolution()If true, multiplies the values by the x-resolution, if it exists. -
setApplyResolution
public void setApplyResolution(boolean applyResolution) If true, multiplies the values by the x-resolution, if it exists. -
isIgnoreZIfNaN
public boolean isIgnoreZIfNaN()If true and the z-resolution is undefined, the z dimension is ignored. -
setIgnoreZIfNaN
public void setIgnoreZIfNaN(boolean ignoreZIfNaN) If true and the z-resolution is undefined, the z dimension is ignored.
-