ImageDev

IntensityStatistics

Computes basic statistics of an image.

Access to parameter description

For an introduction: This algorithm gives some image characteristics such as the total number of pixels, the minimum and maximum gray levels, the mean, the range, the standard deviation, the kurtosis, and the skewness factors. The Skewness is the degree of asymmetry of a distribution. The Kurtosis is the degree of peakedness of a distribution, also called the "excess" or "excess coefficient". Kurtosis is a normalized form of the fourth central moment of a distribution.

See also
See related example

Function Syntax

This function returns outputMeasurement.
// Function prototype
StatisticsMsr::Ptr intensityStatistics( std::shared_ptr< iolink::ImageView > inputImage, IntensityStatistics::RangeMode rangeMode, iolink::Vector2i32 intensityInputRange, StatisticsMsr::Ptr outputMeasurement = NULL );
This function returns outputMeasurement.
// Function prototype.
intensity_statistics( input_image,
                      range_mode = IntensityStatistics.RangeMode.MIN_MAX,
                      intensity_input_range = [0, 255],
                      output_measurement = None )
This function returns outputMeasurement.
// Function prototype.
public static StatisticsMsr
IntensityStatistics( IOLink.ImageView inputImage,
                     IntensityStatistics.RangeMode rangeMode = ImageDev.IntensityStatistics.RangeMode.MIN_MAX,
                     int[] intensityInputRange = null,
                     StatisticsMsr outputMeasurement = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. It can be grayscale, color, multi-channel, or time series. Image Binary, Label, Grayscale or Multispectral nullptr
input
rangeMode
The way to determine the input intensity range within which statistics are computed.
MIN_MAX The measurements are computed between the minimum and the maximum of the image.
OTHER The measurements are computed between user-defined bounds [a,b].
Enumeration MIN_MAX
input
intensityInputRange
The input intensity range [a,b] within which the statistics are computed. This parameter is ignored if the range mode is set to MIN_MAX. Vector2i32 Any value {0, 255}
output
outputMeasurement
The output measurement results. StatisticsMsr nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. It can be grayscale, color, multi-channel, or time series. image Binary, Label, Grayscale or Multispectral None
input
range_mode
The way to determine the input intensity range within which statistics are computed.
MIN_MAX The measurements are computed between the minimum and the maximum of the image.
OTHER The measurements are computed between user-defined bounds [a,b].
enumeration MIN_MAX
input
intensity_input_range
The input intensity range [a,b] within which the statistics are computed. This parameter is ignored if the range mode is set to MIN_MAX. vector2i32 Any value [0, 255]
output
output_measurement
The output measurement results. StatisticsMsr None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. It can be grayscale, color, multi-channel, or time series. Image Binary, Label, Grayscale or Multispectral null
input
rangeMode
The way to determine the input intensity range within which statistics are computed.
MIN_MAX The measurements are computed between the minimum and the maximum of the image.
OTHER The measurements are computed between user-defined bounds [a,b].
Enumeration MIN_MAX
input
intensityInputRange
The input intensity range [a,b] within which the statistics are computed. This parameter is ignored if the range mode is set to MIN_MAX. Vector2i32 Any value {0, 255}
output
outputMeasurement
The output measurement results. StatisticsMsr null

Object Examples

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

IntensityStatistics intensityStatisticsAlgo;
intensityStatisticsAlgo.setInputImage( polystyrene );
intensityStatisticsAlgo.setRangeMode( IntensityStatistics::RangeMode::MIN_MAX );
intensityStatisticsAlgo.setIntensityInputRange( {0, 255} );
intensityStatisticsAlgo.execute();

std::cout << "pixelCount: " << intensityStatisticsAlgo.outputMeasurement()->pixelCount( 0 , 0 ) ;
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))

intensity_statistics_algo = imagedev.IntensityStatistics()
intensity_statistics_algo.input_image = polystyrene
intensity_statistics_algo.range_mode = imagedev.IntensityStatistics.MIN_MAX
intensity_statistics_algo.intensity_input_range = [0, 255]
intensity_statistics_algo.execute()

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

IntensityStatistics intensityStatisticsAlgo = new IntensityStatistics
{
    inputImage = polystyrene,
    rangeMode = IntensityStatistics.RangeMode.MIN_MAX,
    intensityInputRange = new int[]{0, 255}
};
intensityStatisticsAlgo.Execute();

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

Function Examples

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

auto result = intensityStatistics( polystyrene, IntensityStatistics::RangeMode::MIN_MAX, {0, 255} );

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

result = imagedev.intensity_statistics( polystyrene, imagedev.IntensityStatistics.MIN_MAX, [0, 255] )

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

StatisticsMsr result = Processing.IntensityStatistics( polystyrene, IntensityStatistics.RangeMode.MIN_MAX, new int[]{0, 255} );

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