ImageDev

LocalDensityMap3d

Measures the local density of a three-dimensional binary image within a binary mask.

Access to parameter description

This algorithm computes the density using a region formed by the intersection of a mask image and a user-defined kernel. Image borders are mirrored to ensure full kernel processing for pixels at the image boundary. The output image type is float.

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > localDensityMap3d( std::shared_ptr< iolink::ImageView > inputBinaryImage, std::shared_ptr< iolink::ImageView > inputMaskImage, iolink::Vector3i32 kernelSize, std::shared_ptr< iolink::ImageView > outputImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The input binary image. Image Binary nullptr
input
inputMaskImage
The binary mask image. This image must have same dimensions and type as the main input image. Image Binary nullptr
input
kernelSize
The side size in voxels of the cubic kernel. Vector3i32 >0 {3, 3, 3}
output
outputImage
Its dimensions are forced to the same values as the input. Its data type is forced to floating point. Image nullptr

Object Examples

auto foam_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep.vip" );

LocalDensityMap3d localDensityMap3dAlgo;
localDensityMap3dAlgo.setInputBinaryImage( foam_sep );
localDensityMap3dAlgo.setInputMaskImage( foam_sep );
localDensityMap3dAlgo.setKernelSize( {3, 3, 3} );
localDensityMap3dAlgo.execute();

std::cout << "outputImage:" << localDensityMap3dAlgo.outputImage()->toString();

Function Examples

auto foam_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep.vip" );

auto result = localDensityMap3d( foam_sep, foam_sep, {3, 3, 3} );

std::cout << "outputImage:" << result->toString();