ImageDev

MomentsOfInertia3d

Computes the elements of the covariance matrix of a three-dimensional grayscale image.

Access to parameter description

For an introduction: This algorithm computes the variance-covariance matrix of the input image. It outputs an object containing the $M_{2x}$, $M_{2y}$, $M_{2z}$, $M_{xy}$, $M_{xz}$ and $M_{yz}$ elements of this matrix. This object also contains the orientations of the largest and smallest eigenvector of the covariance matrix.

For this measurement the image calibration is ignored. The coordinates used to calculate the moments are expressed in voxels.

See also

Function Syntax

This function returns outputMeasurement.
// Function prototype
MomentsOfInertia3dMsr::Ptr momentsOfInertia3d( std::shared_ptr< iolink::ImageView > inputImage, MomentsOfInertia3dMsr::Ptr outputMeasurement = NULL );
This function returns outputMeasurement.
// Function prototype.
moments_of_inertia_3d( input_image, output_measurement = None )
This function returns outputMeasurement.
// Function prototype.
public static MomentsOfInertia3dMsr
MomentsOfInertia3d( IOLink.ImageView inputImage, MomentsOfInertia3dMsr outputMeasurement = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input grayscale image. Image Binary, Label or Grayscale nullptr
output
outputMeasurement
The output measurement result. MomentsOfInertia3dMsr nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input grayscale image. image Binary, Label or Grayscale None
output
output_measurement
The output measurement result. MomentsOfInertia3dMsr None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input grayscale image. Image Binary, Label or Grayscale null
output
outputMeasurement
The output measurement result. MomentsOfInertia3dMsr null

Object Examples

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

MomentsOfInertia3d momentsOfInertia3dAlgo;
momentsOfInertia3dAlgo.setInputImage( foam );
momentsOfInertia3dAlgo.execute();

std::cout << "momentXX: " << momentsOfInertia3dAlgo.outputMeasurement()->momentXX( ) ;
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

moments_of_inertia_3d_algo = imagedev.MomentsOfInertia3d()
moments_of_inertia_3d_algo.input_image = foam
moments_of_inertia_3d_algo.execute()

print( "momentXX: ", str( moments_of_inertia_3d_algo.output_measurement.moment_x_x( ) ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

MomentsOfInertia3d momentsOfInertia3dAlgo = new MomentsOfInertia3d
{
    inputImage = foam
};
momentsOfInertia3dAlgo.Execute();

Console.WriteLine( "momentXX: " + momentsOfInertia3dAlgo.outputMeasurement.momentXX( ) );

Function Examples

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

auto result = momentsOfInertia3d( foam );

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

result = imagedev.moments_of_inertia_3d( foam )

print( "momentXX: ", str( result.moment_x_x( ) )  )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

MomentsOfInertia3dMsr result = Processing.MomentsOfInertia3d( foam );

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