AdaptiveThresholding3d
Performs a binarization of a grayscale image based on the mean intensity of a sliding window centered around each voxel.
Access to parameter description
Each voxel value $I$ is compared to the mean intensity $\mu(I)$ of its local window.
The corresponding voxel in the binary output depends on a threshold value, an arithmetic mode, and a comparison criterion.
See also
Access to parameter description
Each voxel value $I$ is compared to the mean intensity $\mu(I)$ of its local window.
The corresponding voxel in the binary output depends on a threshold value, an arithmetic mode, and a comparison criterion.
- In additive mode, with comparison criterion set to GREATER_OR_EQUAL, the output is set to 1 if $I \geq threshold + \mu(I)$.
- In multiplicative mode, with comparison criterion set to GREATER_OR_EQUAL, the output is set to 1 if $I \geq threshold \times \mu(I)$.
See also
Function Syntax
This function returns the outputBinaryImage output parameter.
// Function prototype. std::shared_ptr< iolink::ImageView > adaptiveThresholding3d( std::shared_ptr< iolink::ImageView > inputImage, int32_t kernelRadiusX, int32_t kernelRadiusY, int32_t kernelRadiusZ, double threshold, AdaptiveThresholding3d::ComparisonCriterion comparisonCriterion, AdaptiveThresholding3d::ThresholdMode thresholdMode, std::shared_ptr< iolink::ImageView > outputBinaryImage = NULL );
This function returns the outputBinaryImage output parameter.
// Function prototype. adaptive_thresholding_3d( input_image, kernel_radius_x = 30, kernel_radius_y = 30, kernel_radius_z = 30, threshold = 1, comparison_criterion = AdaptiveThresholding3d.ComparisonCriterion.GREATER_OR_EQUAL, threshold_mode = AdaptiveThresholding3d.ThresholdMode.MULTIPLICATIVE, output_binary_image = None )
This function returns the outputBinaryImage output parameter.
// Function prototype. public static IOLink.ImageView AdaptiveThresholding3d( IOLink.ImageView inputImage, Int32 kernelRadiusX = 30, Int32 kernelRadiusY = 30, Int32 kernelRadiusZ = 30, double threshold = 1, AdaptiveThresholding3d.ComparisonCriterion comparisonCriterion = ImageDev.AdaptiveThresholding3d.ComparisonCriterion.GREATER_OR_EQUAL, AdaptiveThresholding3d.ThresholdMode thresholdMode = ImageDev.AdaptiveThresholding3d.ThresholdMode.MULTIPLICATIVE, IOLink.ImageView outputBinaryImage = null );
Class Syntax
Parameters
Class Name | AdaptiveThresholding3d |
---|
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
inputImage |
The input image. Its type can be integer or float. | Image | Grayscale | nullptr | |||||
kernelRadiusX |
The horizontal kernel size in voxels. | Int32 | >=1 | 30 | |||||
kernelRadiusY |
The vertical kernel size in voxels. | Int32 | >=1 | 30 | |||||
kernelRadiusZ |
The depth kernel size in voxels. | Int32 | >=1 | 30 | |||||
threshold |
The fraction or the additive thresholding value, according to the thresholdMode parameter value. | Float64 | Any value | 1 | |||||
comparisonCriterion |
The comparison test to perform between image and value.
|
Enumeration | GREATER_OR_EQUAL | ||||||
thresholdMode |
The local thresholding mode.
|
Enumeration | MULTIPLICATIVE | ||||||
outputBinaryImage |
The output binary image. Its dimensions are forced to the same values as the input. | Image | nullptr |
Object Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); AdaptiveThresholding3d adaptiveThresholding3dAlgo; adaptiveThresholding3dAlgo.setInputImage( foam ); adaptiveThresholding3dAlgo.setKernelRadiusX( 30 ); adaptiveThresholding3dAlgo.setKernelRadiusY( 30 ); adaptiveThresholding3dAlgo.setKernelRadiusZ( 30 ); adaptiveThresholding3dAlgo.setThreshold( 1.0 ); adaptiveThresholding3dAlgo.setComparisonCriterion( AdaptiveThresholding3d::ComparisonCriterion::GREATER_OR_EQUAL ); adaptiveThresholding3dAlgo.setThresholdMode( AdaptiveThresholding3d::ThresholdMode::MULTIPLICATIVE ); adaptiveThresholding3dAlgo.execute(); std::cout << "outputBinaryImage:" << adaptiveThresholding3dAlgo.outputBinaryImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip")) adaptive_thresholding_3d_algo = imagedev.AdaptiveThresholding3d() adaptive_thresholding_3d_algo.input_image = foam adaptive_thresholding_3d_algo.kernel_radius_x = 30 adaptive_thresholding_3d_algo.kernel_radius_y = 30 adaptive_thresholding_3d_algo.kernel_radius_z = 30 adaptive_thresholding_3d_algo.threshold = 1.0 adaptive_thresholding_3d_algo.comparison_criterion = imagedev.AdaptiveThresholding3d.GREATER_OR_EQUAL adaptive_thresholding_3d_algo.threshold_mode = imagedev.AdaptiveThresholding3d.MULTIPLICATIVE adaptive_thresholding_3d_algo.execute() print( "output_binary_image:", str( adaptive_thresholding_3d_algo.output_binary_image ) );
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" ); AdaptiveThresholding3d adaptiveThresholding3dAlgo = new AdaptiveThresholding3d { inputImage = foam, kernelRadiusX = 30, kernelRadiusY = 30, kernelRadiusZ = 30, threshold = 1.0, comparisonCriterion = AdaptiveThresholding3d.ComparisonCriterion.GREATER_OR_EQUAL, thresholdMode = AdaptiveThresholding3d.ThresholdMode.MULTIPLICATIVE }; adaptiveThresholding3dAlgo.Execute(); Console.WriteLine( "outputBinaryImage:" + adaptiveThresholding3dAlgo.outputBinaryImage.ToString() );
Function Examples
auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" ); auto result = adaptiveThresholding3d( foam, 30, 30, 30, 1.0, AdaptiveThresholding3d::ComparisonCriterion::GREATER_OR_EQUAL, AdaptiveThresholding3d::ThresholdMode::MULTIPLICATIVE ); std::cout << "outputBinaryImage:" << result->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip")) result = imagedev.adaptive_thresholding_3d( foam, 30, 30, 30, 1.0, imagedev.AdaptiveThresholding3d.GREATER_OR_EQUAL, imagedev.AdaptiveThresholding3d.MULTIPLICATIVE ) print( "output_binary_image:", str( result ) );
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" ); IOLink.ImageView result = Processing.AdaptiveThresholding3d( foam, 30, 30, 30, 1.0, AdaptiveThresholding3d.ComparisonCriterion.GREATER_OR_EQUAL, AdaptiveThresholding3d.ThresholdMode.MULTIPLICATIVE ); Console.WriteLine( "outputBinaryImage:" + result.ToString() );