ImageDev

ObjectVolume

Measures the volume of objects contained in a volume of interest defined in a binary image.

Access to parameter description

For an introduction: This algorithm measures the total volume $V$ of binarized objects within the image. See also

Function Syntax

This function returns outputMeasurement.
// Function prototype
ObjectVolumeMsr::Ptr objectVolume( std::shared_ptr< iolink::ImageView > inputBinaryImage, std::shared_ptr< iolink::ImageView > inputMaskImage, ObjectVolumeMsr::Ptr outputMeasurement = nullptr );
This function returns outputMeasurement.
// Function prototype.
object_volume(input_binary_image: idt.ImageType,
              input_mask_image: idt.ImageType,
              output_measurement: Union[Any, None] = None) -> ObjectVolumeMsr
This function returns outputMeasurement.
// Function prototype.
public static ObjectVolumeMsr
ObjectVolume( IOLink.ImageView inputBinaryImage,
              IOLink.ImageView inputMaskImage,
              ObjectVolumeMsr 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. ObjectVolumeMsr 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. ObjectVolumeMsr 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. ObjectVolumeMsr 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" );

ObjectVolume objectVolumeAlgo;
objectVolumeAlgo.setInputBinaryImage( polystyrene_sep );
objectVolumeAlgo.setInputMaskImage( polystyrene_mask );
objectVolumeAlgo.execute();

std::cout << "pixelCount: " << objectVolumeAlgo.outputMeasurement()->pixelCount( 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_volume_algo = imagedev.ObjectVolume()
object_volume_algo.input_binary_image = polystyrene_sep
object_volume_algo.input_mask_image = polystyrene_mask
object_volume_algo.execute()

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

ObjectVolume objectVolumeAlgo = new ObjectVolume
{
    inputBinaryImage = polystyrene_sep,
    inputMaskImage = polystyrene_mask
};
objectVolumeAlgo.Execute();

Console.WriteLine( "pixelCount: " + objectVolumeAlgo.outputMeasurement.pixelCount( 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 = objectVolume( polystyrene_sep, polystyrene_mask );

std::cout << "pixelCount: " << result->pixelCount( 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_volume(polystyrene_sep, polystyrene_mask)

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

ObjectVolumeMsr result = Processing.ObjectVolume( polystyrene_sep, polystyrene_mask );

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