ImageDev

AverageObjectCountPerSlice3d

Computes the average number of objects along XY slices inside the volume of interest of a three-dimensional binary image.

Access to parameter description

For an introduction: This algorithm can be used in association with the AverageObjectAreaPerSlice3d algorithm as an indicator of connectivity since great number of small objects along image slices may result in high fragmentation ratio. On the other hand, a small number of objects with large area along image slices may lead to high connectivity.

See also

Function Syntax

This function returns the outputMeasurement output parameter.
// Function prototype.
AverageObjectCountPerSliceMsr::Ptr
averageObjectCountPerSlice3d( std::shared_ptr< iolink::ImageView > inputObjectImage,
                              std::shared_ptr< iolink::ImageView > inputMaskImage,
                              AverageObjectCountPerSliceMsr::Ptr outputMeasurement = NULL );
This function returns the outputMeasurement output parameter.
// Function prototype.
average_object_count_per_slice_3d( input_object_image, input_mask_image, output_measurement = None )
This function returns the outputMeasurement output parameter.
// Function prototype.
public static AverageObjectCountPerSliceMsr
AverageObjectCountPerSlice3d( IOLink.ImageView inputObjectImage,
                              IOLink.ImageView inputMaskImage,
                              AverageObjectCountPerSliceMsr outputMeasurement = null );

Class Syntax

Parameters

Class Name AverageObjectCountPerSlice3d

Parameter Name Description Type Supported Values Default Value
input
inputObjectImage
The 3D binary input image. Image Binary nullptr
input
inputMaskImage
The binary image defining the volume of interest. The measurement is computed from voxels having a value of 1 in this image. If it equals null, the computation is performed from all voxels of the input image. It must have same dimensions as the input image. Image Binary nullptr
output
outputMeasurement
The output measurement result. AverageObjectCountPerSliceMsr nullptr

Object Examples

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

AverageObjectCountPerSlice3d averageObjectCountPerSlice3dAlgo;
averageObjectCountPerSlice3dAlgo.setInputObjectImage( foam_sep );
averageObjectCountPerSlice3dAlgo.setInputMaskImage( foam_sep );
averageObjectCountPerSlice3dAlgo.execute();

std::cout << "count: " << averageObjectCountPerSlice3dAlgo.outputMeasurement()->count( ) ;
foam_sep = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep.vip"))

average_object_count_per_slice_3d_algo = imagedev.AverageObjectCountPerSlice3d()
average_object_count_per_slice_3d_algo.input_object_image = foam_sep
average_object_count_per_slice_3d_algo.input_mask_image = foam_sep
average_object_count_per_slice_3d_algo.execute()

print( "count: ", str( average_object_count_per_slice_3d_algo.output_measurement.count( ) ) )
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" );

AverageObjectCountPerSlice3d averageObjectCountPerSlice3dAlgo = new AverageObjectCountPerSlice3d
{
    inputObjectImage = foam_sep,
    inputMaskImage = foam_sep
};
averageObjectCountPerSlice3dAlgo.Execute();

Console.WriteLine( "count: " + averageObjectCountPerSlice3dAlgo.outputMeasurement.count( ) );

Function Examples

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

auto result = averageObjectCountPerSlice3d( foam_sep, foam_sep );

std::cout << "count: " << result->count( ) ;
foam_sep = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep.vip"))

result = imagedev.average_object_count_per_slice_3d( foam_sep, foam_sep )

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

AverageObjectCountPerSliceMsr result = Processing.AverageObjectCountPerSlice3d( foam_sep, foam_sep );

Console.WriteLine(  "count: " + result.count( )  );