ImageDev

RadialIntensityProfile2d

Computes a radial intensity profile on a 2D image.

Access to parameter description

This algorithm computes an intensity profile that consists in the average intensity at a distance r from a given center.

The output is a 3-column spreadsheet indicating, for each radius, the corresponding average intensity value and standard deviation.

See also

Function Syntax

This function returns outputMeasurement.
// Function prototype
RadialIntensityProfileMsr::Ptr radialIntensityProfile2d( std::shared_ptr< iolink::ImageView > inputImage, RadialIntensityProfile2d::CenterMode centerMode, iolink::Vector2u32 center, uint32_t maximumRadius, RadialIntensityProfileMsr::Ptr outputMeasurement = NULL );
This function returns outputMeasurement.
// Function prototype.
radial_intensity_profile_2d( input_image,
                             center_mode = RadialIntensityProfile2d.CenterMode.IMAGE_CENTER,
                             center = [0, 0],
                             maximum_radius = 0,
                             output_measurement = None )
This function returns outputMeasurement.
// Function prototype.
public static RadialIntensityProfileMsr
RadialIntensityProfile2d( IOLink.ImageView inputImage,
                          RadialIntensityProfile2d.CenterMode centerMode = ImageDev.RadialIntensityProfile2d.CenterMode.IMAGE_CENTER,
                          uint[] center = null,
                          UInt32 maximumRadius = 0,
                          RadialIntensityProfileMsr outputMeasurement = null );

Class Syntax

Parameters

Class Name RadialIntensityProfile2d

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Any type of image is accepted. Image Binary, Label, Grayscale or Multispectral nullptr
input
centerMode
The way to define the origin of the radii.
IMAGE_CENTER The origin of the radii is the center of the input image.
OTHER The origin of the radii is user defined.
Enumeration IMAGE_CENTER
input
center
The origin of the radii in pixel coordinates. It is only used in OTHER mode. Vector2u32 Any value {0, 0}
input
maximumRadius
The radius in pixels up to which intensities are included in the profile. UInt32 Any value 0
output
outputMeasurement
The output object containing the computed radii, averaged intensities, and standard deviation. RadialIntensityProfileMsr nullptr

Object Examples

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

RadialIntensityProfile2d radialIntensityProfile2dAlgo;
radialIntensityProfile2dAlgo.setInputImage( polystyrene );
radialIntensityProfile2dAlgo.setCenterMode( RadialIntensityProfile2d::CenterMode::IMAGE_CENTER );
radialIntensityProfile2dAlgo.setCenter( {0, 0} );
radialIntensityProfile2dAlgo.setMaximumRadius( 255 );
radialIntensityProfile2dAlgo.execute();

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

radial_intensity_profile_2d_algo = imagedev.RadialIntensityProfile2d()
radial_intensity_profile_2d_algo.input_image = polystyrene
radial_intensity_profile_2d_algo.center_mode = imagedev.RadialIntensityProfile2d.IMAGE_CENTER
radial_intensity_profile_2d_algo.center = [0, 0]
radial_intensity_profile_2d_algo.maximum_radius = 255
radial_intensity_profile_2d_algo.execute()

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

RadialIntensityProfile2d radialIntensityProfile2dAlgo = new RadialIntensityProfile2d
{
    inputImage = polystyrene,
    centerMode = RadialIntensityProfile2d.CenterMode.IMAGE_CENTER,
    center = new uint[]{0, 0},
    maximumRadius = 255
};
radialIntensityProfile2dAlgo.Execute();

Console.WriteLine( "mean: " + radialIntensityProfile2dAlgo.outputMeasurement.mean( 0 , 0 , 0 ) );

Function Examples

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

auto result = radialIntensityProfile2d( polystyrene, RadialIntensityProfile2d::CenterMode::IMAGE_CENTER, {0, 0}, 255 );

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

result = imagedev.radial_intensity_profile_2d( polystyrene, imagedev.RadialIntensityProfile2d.IMAGE_CENTER, [0, 0], 255 )

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

RadialIntensityProfileMsr result = Processing.RadialIntensityProfile2d( polystyrene, RadialIntensityProfile2d.CenterMode.IMAGE_CENTER, new uint[]{0, 0}, 255 );

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