ImageDev

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: This algorithm measures the Image Ratio $IR$ (that is, the percentage of binarized structures relative to the total volume). It is computed as follows: where See also

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 = nullptr );
This function returns outputMeasurement.
// Function prototype.
object_image_ratio(input_binary_image: idt.ImageType,
                   input_mask_image: idt.ImageType,
                   output_measurement: Union[Any, None] = None) -> ObjectImageRatioMsr
This function returns outputMeasurement.
// Function prototype.
public static ObjectImageRatioMsr
ObjectImageRatio( IOLink.ImageView inputBinaryImage,
                  IOLink.ImageView inputMaskImage,
                  ObjectImageRatioMsr outputMeasurement = 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 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. ObjectImageRatioMsr 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 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 None
output
output_measurement
The output measurement result. ObjectImageRatioMsr None
Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The input binary image. Image Binary null
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 null
output
outputMeasurement
The output measurement result. ObjectImageRatioMsr null

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

object_image_ratio_algo = imagedev.ObjectImageRatio()
object_image_ratio_algo.input_binary_image = polystyrene_sep
object_image_ratio_algo.input_mask_image = polystyrene_mask
object_image_ratio_algo.execute()

print("percentage: ", str(object_image_ratio_algo.output_measurement.percentage(0)))
ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" );
ImageView polystyrene_mask = Data.ReadVipImage( @"Data/images/polystyrene_mask.vip" );

ObjectImageRatio objectImageRatioAlgo = new ObjectImageRatio
{
    inputBinaryImage = polystyrene_sep,
    inputMaskImage = polystyrene_mask
};
objectImageRatioAlgo.Execute();

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

result = imagedev.object_image_ratio(polystyrene_sep, polystyrene_mask)

print("percentage: ", str(result.percentage(0)))
ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" );
ImageView polystyrene_mask = Data.ReadVipImage( @"Data/images/polystyrene_mask.vip" );

ObjectImageRatioMsr result = Processing.ObjectImageRatio( polystyrene_sep, polystyrene_mask );

Console.WriteLine(  "percentage: " + result.percentage( 0 )  );