IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Generic Seeded Distance Map 3dSee full documentation
imagegenericSeededDistanceMap3dImg (inBinImg3d,inBinSeedImg3d,inDistWeight3d)
imagegenericSeededDistanceMap3dImg (inBinImg3d,inBinSeedImg3d,inDistWeight3d,maxDistanc)

Detailed Description

generic seeded distance map transform of a 3d input binary image according to a 3d seeded image

3d generic seeded distance map algorithm is the 3d extension of Generic 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 given weights stored in a ipsdk::imaproc::attr::DistWeight3d attribute. 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 $ maxDistance $ is provided, the propagation is constrained so that it stops when the distance is higher than the $ maxDistance $ value.

The resulting image buffer type must be one of the following :

See Generic Seeded Distance Map 2d for more details.

Here is an example of a 3d seeded distance map computation applied to a binary input image with a real result image with each weighting coefficients set to 1 :

genericSeededDistanceMap3dImg.png
See also
Generic Seeded Distance Map 2d

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLAdvancedMorphology as advmorpho

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
inSeedsImg = PyIPSDK.loadTiffImageFile(inputSeedsImgPath)
# setting of used distance weights
inDistWeight3d = PyIPSDK.createDistWeight3d(1, 1, 2, math.sqrt(2), math.sqrt(5), math.sqrt(5), math.sqrt(6))
# generic seeded distance map 3d computation
outDistImg = advmorpho.genericSeededDistanceMap3dImg(inImg, inSeedsImg, inDistWeight3d)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLAdvancedMorphology/Processor/GenericSeededDistanceMap3dImg/GenericSeededDistanceMap3dImg.h>

Code Example

// opening input image
ImagePtr pInBinImg = loadTiffImageFile(inputImgPath);
// opening seed input image
ImagePtr pInSeedImg = loadTiffImageFile(inputSeedImgPath);
// Distance weighting coefficients
DistWeight3dPtr pDistWeight3d = createDistWeight3d(xWeight, yWeight, zWeight, xyWeight, xzWeight, yzWeight, xyzWeight);
// define output image geometry
ImageGeometryPtr pDistGeometry = geometry3d(outputImageBufferType,
pInBinImg->getSizeX(),
pInBinImg->getSizeY(),
pInBinImg->getSizeZ());
// creation of output image
boost::shared_ptr<MemoryImage> pOutDistImg(boost::make_shared<MemoryImage>());
pOutDistImg->init(*pDistGeometry);
// compute distance map on input image
genericSeededDistanceMap3dImg(pInBinImg, pInSeedImg, pDistWeight3d, pOutDistImg);