ImageDev

EulerNumber3d

Measures the Euler characteristic, which is a topological invariant indicator, from objects of a three-dimensional binary image.

Access to parameter description

For an introduction: section Image Analysis.

The Euler number, or Euler-Poincar characteristic $\chi$, or connectivity number, is a topological parameter which describes the structure of an object, regardless of its specific geometric shape. This indicator is topologically invariant, which means it remains unchanged by elastic transformations of the studied structure. Other topological parameters exist, such as the number of branches or of triple points in a skeleton, the hierarchical degree of a tree-like skeleton or the number of neighbours for a cell in a skeleton by zone of influence.

The Euler number is correlated with the "redundant connectivity", which can be defined as the maximal number of branches of a structure that may be cut without splitting it into several unconnected parts.

In 3D the Euler number is related to the three Betti numbers: The 3D Euler number is defined as $$ \chi=\beta_0-\beta_1+\beta_2 = C-T+H $$

This algorithm computes the Euler number as the sum of measurements in local neighborhoods, considering the 26-connectivity. In the continuous case, this measurement is null almost everywhere, except on contours.

In the 3D discrete case, this local measurement is derived from the Euler formula for graph $$\chi=C-T+H=V+F-E$$ where $\beta_0$ is the number of connected components, $\beta_1$ the connectivity, $\beta_2$ the number of of enclosed cavities, $V$ the number of vertices, $F$ the number of elementary faces, and $E$ the number of edges.

<b> Figure 1.</b> Euler 3D number on basic shapes
Figure 1. Euler 3D number on basic shapes


The number of objects or connected components is straightforward to compute with the Labeling3d algorithm. The number of holes can be computed by labeling the image background. The number of tunnels can be deduced by subtracting the Euler number from the sum of the number of connected components $C$ and number of enclosed cavities $H$.

References See also

Function Syntax

This function returns the outputMeasurement output parameter.
// Function prototype.
Euler3dMsr::Ptr
eulerNumber3d( std::shared_ptr< iolink::ImageView > inputBinaryImage, Euler3dMsr::Ptr outputMeasurement = NULL );
This function returns the outputMeasurement output parameter.
// Function prototype.
euler_number_3d( input_binary_image, output_measurement = None )
This function returns the outputMeasurement output parameter.
// Function prototype.
public static Euler3dMsr
EulerNumber3d( IOLink.ImageView inputBinaryImage, Euler3dMsr outputMeasurement = null );

Class Syntax

Parameters

Class Name EulerNumber3d

Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The 3D binary input image. Image Binary nullptr
output
outputMeasurement
The output measurement result. Euler3dMsr nullptr

Object Examples

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

EulerNumber3d eulerNumber3dAlgo;
eulerNumber3dAlgo.setInputBinaryImage( foam_sep );
eulerNumber3dAlgo.execute();

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

euler_number_3d_algo = imagedev.EulerNumber3d()
euler_number_3d_algo.input_binary_image = foam_sep
euler_number_3d_algo.execute()

print( 
print("eulerNumber: ", euler_number_3d_algo.output_measurement.euler_number( ) ) );
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" );

EulerNumber3d eulerNumber3dAlgo = new EulerNumber3d
{
    inputBinaryImage = foam_sep
};
eulerNumber3dAlgo.Execute();

Console.WriteLine( "eulerNumber: " + eulerNumber3dAlgo.outputMeasurement.eulerNumber( ) );

Function Examples

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

auto result = eulerNumber3d( foam_sep );

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

result = imagedev.euler_number_3d( foam_sep )

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

Euler3dMsr result = Processing.EulerNumber3d( foam_sep );

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