Class DistanceTransform3D
- All Implemented Interfaces:
Provider<Channel>
,ProviderAsStack
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 TypeMethodDescriptioncreateDistanceMapForVoxels
(BinaryVoxels<UnsignedByteBuffer> voxels, Optional<Resolution> resolution, float multiplyByZRes) Creates a distance map for binary voxels.protected Channel
createFromMask
(Mask mask) float
A factor to multiply the distance values by.boolean
If true, multiplies the values by the x-resolution, if it exists.boolean
If true, creates a short (16-bit) output instead of byte (8-bit).boolean
If true and the z-resolution is undefined, the z dimension is ignored.boolean
If true, suppresses the z-dimension in distance calculations.void
setApplyResolution
(boolean applyResolution) If true, multiplies the values by the x-resolution, if it exists.void
setCreateShort
(boolean createShort) If true, creates a short (16-bit) output instead of byte (8-bit).void
setIgnoreZIfNaN
(boolean ignoreZIfNaN) If true and the z-resolution is undefined, the z dimension is ignored.void
setMultiplyBy
(float multiplyBy) A factor to multiply the distance values by.void
setSuppressZ
(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, setMask
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
-
DistanceTransform3D
public DistanceTransform3D()
-
-
Method Details
-
createFromMask
Description copied from class:FromMaskBase
- Specified by:
createFromMask
in classFromMaskBase
- Parameters:
mask
- theMask
to create the channel from- Returns:
- the created
Channel
- Throws:
ProvisionFailedException
- if the channel creation fails
-
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
Voxels
ofUnsignedByteBuffer
- 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.
-