ObjectImageRatio
Measures the proportion of the image occupied by objects contained inside the volume of interest of a binary image.
Access to parameter description
For an introduction:
Access to parameter description
For an introduction:
- section Image Analysis
- section Morphometry
- on a 2D image IR=100×Ar/T.Ar
- on a 3D image IR=100×V/TV
- Ar is the object area.
- T.Ar is the total area (area of the mask if provided, else area of the image bounding box).
- V is the object volume.
- TV is the total volume (volume of the mask if provided, else volume of the image bounding box).
Function Syntax
This function returns outputMeasurement.
// Function prototype
ObjectImageRatioMsr::Ptr objectImageRatio( std::shared_ptr< iolink::ImageView > inputBinaryImage, std::shared_ptr< iolink::ImageView > inputMaskImage, ObjectImageRatioMsr::Ptr outputMeasurement = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |
---|---|---|---|---|---|
![]() |
inputBinaryImage |
The input binary image. | Image | Binary | nullptr |
![]() |
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 |
![]() |
outputMeasurement |
The output measurement result. | ObjectImageRatioMsr | nullptr |
Object Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); auto polystyrene_mask = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_mask.vip" ); ObjectImageRatio objectImageRatioAlgo; objectImageRatioAlgo.setInputBinaryImage( polystyrene_sep ); objectImageRatioAlgo.setInputMaskImage( polystyrene_mask ); objectImageRatioAlgo.execute(); std::cout << "percentage: " << objectImageRatioAlgo.outputMeasurement()->percentage( 0 ) ;
Function Examples
auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" ); auto polystyrene_mask = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_mask.vip" ); auto result = objectImageRatio( polystyrene_sep, polystyrene_mask ); std::cout << "percentage: " << result->percentage( 0 ) ;