TotalImageVolume
Measures the volume of interest of a binary image.
Access to parameter description
For an introduction:
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.
Access to parameter description
For an introduction:
- section Image Analysis
- section Morphometry
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
- On a 2D image $ TV = gx \times cx \times gy \times cy $
- On a 3D image $ TV = gx \times cx \times gy \times cy \times gy \times cy \times gz \times cz \times gx \times cx \times gz \times cz $
- gx, gy and gz represent the image size in pixel coordinates along the X, Y, and Z axes respectively.
- cx, cy and cz represent the image calibration spacing in world coordinates along the X, Y, and Z axes.
Usage with a mask
- On a 2D image $ TV = Ar(M) $
- On a 3D image $ TV = V(M) $
- $M$ is the binary mask image.
- $Ar$ is the 2D area given by the Area2d algorithm.
- $V$ is the 3D volume given by the IntensityIntegral3d algorithm in the binary case.
Function Syntax
This function returns the outputMeasurement output parameter.
// Function prototype. ImageVolumeMsr::Ptr totalImageVolume( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > inputMaskImage, ImageVolumeMsr::Ptr outputMeasurement = NULL );
This function returns the outputMeasurement output parameter.
// Function prototype. total_image_volume( input_image, input_mask_image, output_measurement = None )
This function returns the outputMeasurement output parameter.
// 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 | |
---|---|---|---|---|---|
inputImage |
The input image. | Image | Binary, Label, Grayscale or Multispectral | 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. | 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( print("pixelCount: ", 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: ", 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 ) );