ImageDev

TotalImageVolume

Measures the volume of interest of a binary image.

Access to parameter description

For an introduction: This algorithm measures the volume of interest $TV$ of an image.
On a 2D image, this measurement is more precisely an area, and has dimension 2. On a 3D image, it corresponds to a volume and has dimension 3.
If no mask is provided, it corresponds to the total volume of the input image. If a mask is provided, it corresponds to the volume of the mask image.

Usage without a mask

where

Usage with a mask

where See also

Function Syntax

This function returns outputMeasurement.
// Function prototype
ImageVolumeMsr::Ptr totalImageVolume( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > inputMaskImage, ImageVolumeMsr::Ptr outputMeasurement = NULL );
This function returns outputMeasurement.
// Function prototype.
total_image_volume( input_image, input_mask_image, output_measurement = None )
This function returns outputMeasurement.
// Function prototype.
public static ImageVolumeMsr
TotalImageVolume( IOLink.ImageView inputImage,
                  IOLink.ImageView inputMaskImage,
                  ImageVolumeMsr outputMeasurement = null );

Class Syntax

Parameters

Class Name TotalImageVolume

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral 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. ImageVolumeMsr nullptr

Object Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );
auto polystyrene_mask = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_mask.vip" );

TotalImageVolume totalImageVolumeAlgo;
totalImageVolumeAlgo.setInputImage( polystyrene );
totalImageVolumeAlgo.setInputMaskImage( polystyrene_mask );
totalImageVolumeAlgo.execute();

std::cout << "pixelCount: " << totalImageVolumeAlgo.outputMeasurement()->pixelCount( 0 ) ;
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))
polystyrene_mask = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_mask.vip"))

total_image_volume_algo = imagedev.TotalImageVolume()
total_image_volume_algo.input_image = polystyrene
total_image_volume_algo.input_mask_image = polystyrene_mask
total_image_volume_algo.execute()

print( "pixelCount: ", str( total_image_volume_algo.output_measurement.pixel_count( 0 ) ) )
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );
ImageView polystyrene_mask = Data.ReadVipImage( @"Data/images/polystyrene_mask.vip" );

TotalImageVolume totalImageVolumeAlgo = new TotalImageVolume
{
    inputImage = polystyrene,
    inputMaskImage = polystyrene_mask
};
totalImageVolumeAlgo.Execute();

Console.WriteLine( "pixelCount: " + totalImageVolumeAlgo.outputMeasurement.pixelCount( 0 ) );

Function Examples

std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );
auto polystyrene_mask = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_mask.vip" );

auto result = totalImageVolume( polystyrene, polystyrene_mask );

std::cout << "pixelCount: " << result->pixelCount( 0 ) ;
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))
polystyrene_mask = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_mask.vip"))

result = imagedev.total_image_volume( polystyrene, polystyrene_mask )

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

ImageVolumeMsr result = Processing.TotalImageVolume( polystyrene, polystyrene_mask );

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