ImageDev

BinaryAnalysis

Computes a set of measurements globally to an input binary image.

Access to parameter description

For an introduction: This algorithm computes a list of measurements considering all pixels of the binary image as belonging to the same object. It generates an AnalysisMsr output object containing the result values.
It gives a global result on the overall image, considering the non-zero pixels in the image.

If the binary input image has a coordinate system unit defined in its calibration property, analysis results are expressed in this coordinate system unit.

More details about each available measurement can be found in the NativeMeasurement object.

See also

Function Syntax

This function returns outputAnalysis.
// Function prototype
AnalysisMsr::Ptr binaryAnalysis( std::shared_ptr< iolink::ImageView > inputBinaryImage, std::shared_ptr< iolink::ImageView > inputIntensityImage, AnalysisMsr::Ptr outputAnalysis = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputBinaryImage
The binary input image. Image Binary nullptr
input
inputIntensityImage
The intensity input image. If it equals null, the binary input image is used as the intensity input image. Image Binary, Label, Grayscale or Multispectral nullptr
input and output
outputAnalysis
The input and output analysis. This object defines the features to measure and store the results. AnalysisMsr nullptr

Object Examples

auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" );
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );
AnalysisMsr::Ptr analysis= AnalysisMsr::read( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "analysis.vip" );

BinaryAnalysis binaryAnalysisAlgo;
binaryAnalysisAlgo.setInputBinaryImage( polystyrene_sep );
binaryAnalysisAlgo.setInputIntensityImage( polystyrene );
binaryAnalysisAlgo.setOutputAnalysis( analysis );
binaryAnalysisAlgo.execute();

std::cout << "Area2d: " << binaryAnalysisAlgo.outputAnalysis()->get( NativeMeasurements::area2d )->value( 0 ) ;

Function Examples

auto polystyrene_sep = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene_sep.vip" );
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" );
AnalysisMsr::Ptr analysis= AnalysisMsr::read( std::string( IMAGEDEVDATA_OBJECTS_FOLDER ) + "analysis.vip" );

auto result = binaryAnalysis( polystyrene_sep, polystyrene, analysis );

std::cout << "Area2d: " << result->get( NativeMeasurements::area2d )->value( 0 ) ;