ImageDev

RadialBackgroundImage2d

Computes a radial background image from a grayscale image.

Access to parameter description

This algorithm: The center of the radial profile can be the center of the image or a user-defined position.
If the a binary mask is set, the radial profile will be computed only with masked pixels.
To create the output image, the algorithm uses either an average radial profile or a polynomial estimation of the average radial profile.
Thus, all pixels of the output image located at a same distance from the defined center have the same intensity.

See also

Function Syntax

This function returns the outputImage output parameter.
// Function prototype.
std::shared_ptr< iolink::ImageView >
radialBackgroundImage2d( std::shared_ptr< iolink::ImageView > inputImage,
                         std::shared_ptr< iolink::ImageView > inputMaskImage,
                         RadialBackgroundImage2d::BackgroundModel backgroundModel,
                         RadialBackgroundImage2d::CenterMode centerMode,
                         iolink::Vector2i32 centerPoint,
                         std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns the outputImage output parameter.
// Function prototype.
radial_background_image_2d( input_image,
                            input_mask_image,
                            background_model = RadialBackgroundImage2d.BackgroundModel.AVERAGE,
                            center_mode = RadialBackgroundImage2d.CenterMode.IMAGE_CENTER,
                            center_point = [1, 1],
                            output_image = None )
This function returns the outputImage output parameter.
// Function prototype.
public static IOLink.ImageView
RadialBackgroundImage2d( IOLink.ImageView inputImage,
                         IOLink.ImageView inputMaskImage,
                         RadialBackgroundImage2d.BackgroundModel backgroundModel = ImageDev.RadialBackgroundImage2d.BackgroundModel.AVERAGE,
                         RadialBackgroundImage2d.CenterMode centerMode = ImageDev.RadialBackgroundImage2d.CenterMode.IMAGE_CENTER,
                         int[] centerPoint = null,
                         IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Class Name RadialBackgroundImage2d

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Grayscale or Multispectral nullptr
input
inputMaskImage
The binary mask image for the polynomial interpolation. If it equals null, the background is computed from all pixels of the input image. This image must have same dimensions as the input image. Image Binary nullptr
input
backgroundModel
The way to estimate the background model of the Fourier transform module.
AVERAGE The background is estimated as a radial average of the Fourier transform of the whole image.
POLYNOMIAL_ORDER1 The background is estimated by fitting a polynomial of degree one on the radial average of the masked image.
POLYNOMIAL_ORDER2 The background is estimated by fitting a polynomial of degree two on the radial average of the masked image.
POLYNOMIAL_ORDER3 The background is estimated by fitting a polynomial of degree three on the radial average of the masked image.
POLYNOMIAL_ORDER4 The background is estimated by fitting a polynomial of degree four on the radial average of the masked image.
POLYNOMIAL_ORDER5 The background is estimated by fitting a polynomial of degree five on the radial average of the masked image.
POLYNOMIAL_ORDER6 The background is estimated by fitting a polynomial of degree six on the radial average of the masked image.
Enumeration AVERAGE
input
centerMode
The way to define the center of the radial profiles.
IMAGE_CENTER The center of the radial profiles is the center of the input image.
OTHER The center of the radial profiles is user-defined.
Enumeration IMAGE_CENTER
input
centerPoint
The X and Y coordinates used as center if the center mode parameter is set to OTHER. This parameter is ignored in IMAGE_CENTER mode. Vector2i32 >=0 {1, 1}
output
outputImage
The output image. Its dimensions and type are forced to the same values as the input. Image nullptr

Object Examples

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

RadialBackgroundImage2d radialBackgroundImage2dAlgo;
radialBackgroundImage2dAlgo.setInputImage( polystyrene );
radialBackgroundImage2dAlgo.setInputMaskImage( polystyrene_sep );
radialBackgroundImage2dAlgo.setBackgroundModel( RadialBackgroundImage2d::BackgroundModel::AVERAGE );
radialBackgroundImage2dAlgo.setCenterMode( RadialBackgroundImage2d::CenterMode::IMAGE_CENTER );
radialBackgroundImage2dAlgo.setCenterPoint( {1, 1} );
radialBackgroundImage2dAlgo.execute();

std::cout << "outputImage:" << radialBackgroundImage2dAlgo.outputImage()->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))
polystyrene_sep = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep.vip"))

radial_background_image_2d_algo = imagedev.RadialBackgroundImage2d()
radial_background_image_2d_algo.input_image = polystyrene
radial_background_image_2d_algo.input_mask_image = polystyrene_sep
radial_background_image_2d_algo.background_model = imagedev.RadialBackgroundImage2d.AVERAGE
radial_background_image_2d_algo.center_mode = imagedev.RadialBackgroundImage2d.IMAGE_CENTER
radial_background_image_2d_algo.center_point = [1, 1]
radial_background_image_2d_algo.execute()

print( "output_image:", str( radial_background_image_2d_algo.output_image ) );
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );
ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" );

RadialBackgroundImage2d radialBackgroundImage2dAlgo = new RadialBackgroundImage2d
{
    inputImage = polystyrene,
    inputMaskImage = polystyrene_sep,
    backgroundModel = RadialBackgroundImage2d.BackgroundModel.AVERAGE,
    centerMode = RadialBackgroundImage2d.CenterMode.IMAGE_CENTER,
    centerPoint = new int[]{1, 1}
};
radialBackgroundImage2dAlgo.Execute();

Console.WriteLine( "outputImage:" + radialBackgroundImage2dAlgo.outputImage.ToString() );

Function Examples

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

auto result = radialBackgroundImage2d( polystyrene, polystyrene_sep, RadialBackgroundImage2d::BackgroundModel::AVERAGE, RadialBackgroundImage2d::CenterMode::IMAGE_CENTER, {1, 1} );

std::cout << "outputImage:" << result->toString();
polystyrene = ioformat.read_image(imagedev_data.get_image_path("polystyrene.tif"))
polystyrene_sep = imagedev.read_vip_image(imagedev_data.get_image_path("polystyrene_sep.vip"))

result = imagedev.radial_background_image_2d( polystyrene, polystyrene_sep, imagedev.RadialBackgroundImage2d.AVERAGE, imagedev.RadialBackgroundImage2d.IMAGE_CENTER, [1, 1] )

print( "output_image:", str( result ) );
ImageView polystyrene = ViewIO.ReadImage( @"Data/images/polystyrene.tif" );
ImageView polystyrene_sep = Data.ReadVipImage( @"Data/images/polystyrene_sep.vip" );

IOLink.ImageView result = Processing.RadialBackgroundImage2d( polystyrene, polystyrene_sep, RadialBackgroundImage2d.BackgroundModel.AVERAGE, RadialBackgroundImage2d.CenterMode.IMAGE_CENTER, new int[]{1, 1} );

Console.WriteLine( "outputImage:" + result.ToString() );