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 );
This function returns outputImage.
// Function prototype.
local_density_map_3d( input_binary_image,
                      input_mask_image,
                      kernel_size = [3, 3, 3],
                      output_image = None )
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
LocalDensityMap3d( IOLink.ImageView inputBinaryImage,
                   IOLink.ImageView inputMaskImage,
                   int[] kernelSize = null,
                   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
Parameter Name Description Type Supported Values Default Value
input
input_binary_image
The input binary image. image Binary None
input
input_mask_image
The binary mask image. This image must have same dimensions and type as the main input image. image Binary None
input
kernel_size
The side size in voxels of the cubic kernel. vector3i32 >0 [3, 3, 3]
output
output_image
Its dimensions are forced to the same values as the input. Its data type is forced to floating point. image None
Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The input binary image. Image Binary null
input
inputMaskImage
The binary mask image. This image must have same dimensions and type as the main input image. Image Binary null
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 null

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();
foam_sep = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep.vip"))

local_density_map_3d_algo = imagedev.LocalDensityMap3d()
local_density_map_3d_algo.input_binary_image = foam_sep
local_density_map_3d_algo.input_mask_image = foam_sep
local_density_map_3d_algo.kernel_size = [3, 3, 3]
local_density_map_3d_algo.execute()

print( "output_image:", str( local_density_map_3d_algo.output_image ) )
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" );

LocalDensityMap3d localDensityMap3dAlgo = new LocalDensityMap3d
{
    inputBinaryImage = foam_sep,
    inputMaskImage = foam_sep,
    kernelSize = new int[]{3, 3, 3}
};
localDensityMap3dAlgo.Execute();

Console.WriteLine( "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();
foam_sep = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep.vip"))

result = imagedev.local_density_map_3d( foam_sep, foam_sep, [3, 3, 3] )

print( "output_image:", str( result ) )
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" );

IOLink.ImageView result = Processing.LocalDensityMap3d( foam_sep, foam_sep, new int[]{3, 3, 3} );

Console.WriteLine( "outputImage:" + result.ToString() );