| distImg,distWeight3d = | seededDistanceMap3dImg (inBinImg3d,inBinSeedImg3d) |
| distImg,distWeight3d = | seededDistanceMap3dImg (inBinImg3d,inBinSeedImg3d,pixelXSize,pixelYSize,pixelZSize,neighborhood3d) |
| DistWeight3d = | seededDistanceMap3dImg (inBinImg3d,inBinSeedImg3d,pixelXSize,pixelYSize,pixelZSize,neighborhood3d,outDistImg) |
| distImg,distWeight3d = | seededDistanceMap3dImg (inBinImg3d,inBinSeedImg3d,maxDistance) |
| distImg,distWeight3d = | seededDistanceMap3dImg (inBinImg3d,inBinSeedImg3d,pixelXSize,pixelYSize,pixelZSize,neighborhood3d,maxDistance) |
| DistWeight3d = | seededDistanceMap3dImg (inBinImg3d,inBinSeedImg3d,pixelXSize,pixelYSize,pixelZSize,neighborhood3d,maxDistance,outDistImg) |
seeded distance map transform of a 3d input binary image according to a 3d seeded image
3d seeded distance map algorithm is the 3d extension of Seeded Distance Map 2d. It allows to compute the distance to the closest seeded voxel in a region for each voxel of this region, according to the given voxel size. The region is defined by a binary volume with voxel intensities set to 1. The seeded voxels are defined by a seeded volume with voxel intensities set to 1. If the parameter
is provided, the propagation is constrained so that it stops when the distance is higher than the
value.
The resulting image buffer type must be one of the following :
Just like Seeded Distance Map 2d, the voxel size parameters are used to compute the distance weighting coefficients to calculate the resulting distance map. In the case of integer output distance map, these coefficients are calculated as described in the folowwing algorithm [1] :
1- For simplicity in the notation, let
be the size of a voxel.
2- Compute the real coefficient along the x-axis:
with
3- Compute the other coefficients :
4- Compute the integer approximation of the real coefficients.
a- For this, we assume that the maximum calculable distance is
, where
is the maximum between the output volume width, the output volume height and the output volume depth.
b- An integer scale factor
can then be computed. It must be large enough to allow a good approximation to the Euclidian distance and small enough to avoid overflow due to the output image type limitation.
Where
is the number of bits used to encode the each element of the distance map (e.g.
for an unsigned short distance map).
c- The integer distance weighting coefficients can now be calculated as follows :
5- Finally, the original scale must be retrieved and the resulting image is divided by
.
is set to 0 and the neighbourhood along the xyz-direction is not used in the distance calculation. Moreover, if the user defines a 6-connexity,
,
and
are also set to 0.Here is an example of a 3d seeded distance map computation applied to a binary input image with a real result image with an 26-connexity neighbourhood :
[1] "Contribution a la comparaison d'images pour l'evaluation des traitements, la reconnaissance de formes et l'indexation des sequences d'images", Didier COQUIN, HDR, 2007