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×cx×gy×cy
- On a 3D image TV=gx×cx×gy×cy×gy×cy×gz×cz×gx×cx×gz×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 outputMeasurement.
// Function prototype
ImageVolumeMsr::Ptr totalImageVolume( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > inputMaskImage, ImageVolumeMsr::Ptr outputMeasurement = NULL );
Class Syntax
Parameters
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 ) ;
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 ) ;