ImageDev

ObjectLinearDensity3d

Measures the structure linear density inside the volume of interest of a three-dimensional binary image.

Access to parameter description

For an introduction: The structure linear density represents the number of traversals across a structure made per unit length on a linear path.

Plate, rod, and sphere model definitions of object linear density $Dn$ rely on the corresponding average object thickness $Th$ values: $$ Dn = \frac{V}{Th \times TV} $$ where $TV$ is total volume (volume of the mask if provided, else volume of the image bounding box) and $V$ is the object volume.

See also

Function Syntax

This function returns outputMeasurement.
// Function prototype
ObjectLinearDensityMsr::Ptr objectLinearDensity3d( std::shared_ptr< iolink::ImageView > inputImage, std::shared_ptr< iolink::ImageView > inputMaskImage, ObjectLinearDensity3d::Model model, ObjectLinearDensityMsr::Ptr outputMeasurement = nullptr );
This function returns outputMeasurement.
// Function prototype.
object_linear_density_3d(input_image: idt.ImageType,
                         input_mask_image: idt.ImageType,
                         model: ObjectLinearDensity3d.Model = ObjectLinearDensity3d.Model.PARALLEL_PLATE_MODEL,
                         output_measurement: Union[Any, None] = None) -> ObjectLinearDensityMsr
This function returns outputMeasurement.
// Function prototype.
public static ObjectLinearDensityMsr
ObjectLinearDensity3d( IOLink.ImageView inputImage,
                       IOLink.ImageView inputMaskImage,
                       ObjectLinearDensity3d.Model model = ImageDev.ObjectLinearDensity3d.Model.PARALLEL_PLATE_MODEL,
                       ObjectLinearDensityMsr outputMeasurement = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The 3D binary input 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
input
model
The structure model used to compute the measurement.
PARALLEL_PLATE_MODEL The computation uses a parallel plate model.
CYLINDER_ROD_MODEL The computation uses a cylinder rod model.
SPHERE_MODEL The computation uses a sphere model.
Enumeration PARALLEL_PLATE_MODEL
output
outputMeasurement
The output measurement result. ObjectLinearDensityMsr nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The 3D binary input 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
input
model
The structure model used to compute the measurement.
PARALLEL_PLATE_MODEL The computation uses a parallel plate model.
CYLINDER_ROD_MODEL The computation uses a cylinder rod model.
SPHERE_MODEL The computation uses a sphere model.
enumeration PARALLEL_PLATE_MODEL
output
output_measurement
The output measurement result. ObjectLinearDensityMsr None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The 3D binary input 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
input
model
The structure model used to compute the measurement.
PARALLEL_PLATE_MODEL The computation uses a parallel plate model.
CYLINDER_ROD_MODEL The computation uses a cylinder rod model.
SPHERE_MODEL The computation uses a sphere model.
Enumeration PARALLEL_PLATE_MODEL
output
outputMeasurement
The output measurement result. ObjectLinearDensityMsr null

Object Examples

auto foam_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep.vip" );

ObjectLinearDensity3d objectLinearDensity3dAlgo;
objectLinearDensity3dAlgo.setInputImage( foam_sep );
objectLinearDensity3dAlgo.setInputMaskImage( foam_sep );
objectLinearDensity3dAlgo.setModel( ObjectLinearDensity3d::Model::PARALLEL_PLATE_MODEL );
objectLinearDensity3dAlgo.execute();

std::cout << "density: " << objectLinearDensity3dAlgo.outputMeasurement()->density( ) ;
foam_sep = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep.vip"))

object_linear_density_3d_algo = imagedev.ObjectLinearDensity3d()
object_linear_density_3d_algo.input_image = foam_sep
object_linear_density_3d_algo.input_mask_image = foam_sep
object_linear_density_3d_algo.model = imagedev.ObjectLinearDensity3d.PARALLEL_PLATE_MODEL
object_linear_density_3d_algo.execute()

print("density: ", str(object_linear_density_3d_algo.output_measurement.density()))
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" );

ObjectLinearDensity3d objectLinearDensity3dAlgo = new ObjectLinearDensity3d
{
    inputImage = foam_sep,
    inputMaskImage = foam_sep,
    model = ObjectLinearDensity3d.Model.PARALLEL_PLATE_MODEL
};
objectLinearDensity3dAlgo.Execute();

Console.WriteLine( "density: " + objectLinearDensity3dAlgo.outputMeasurement.density( ) );

Function Examples

auto foam_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam_sep.vip" );

auto result = objectLinearDensity3d( foam_sep, foam_sep, ObjectLinearDensity3d::Model::PARALLEL_PLATE_MODEL );

std::cout << "density: " << result->density( ) ;
foam_sep = imagedev.read_vip_image(imagedev_data.get_image_path("foam_sep.vip"))

result = imagedev.object_linear_density_3d(foam_sep, foam_sep, imagedev.ObjectLinearDensity3d.PARALLEL_PLATE_MODEL)

print("density: ", str(result.density()))
ImageView foam_sep = Data.ReadVipImage( @"Data/images/foam_sep.vip" );

ObjectLinearDensityMsr result = Processing.ObjectLinearDensity3d( foam_sep, foam_sep, ObjectLinearDensity3d.Model.PARALLEL_PLATE_MODEL );

Console.WriteLine(  "density: " + result.density( )  );