ImageDev

FloodFillThreshold3d

Transforms a grayscale three-dimensional image into a binary image by performing a region growing from a seed.

Access to parameter description

For an introduction: This algorithm performs a so-called region growing on a 3D image. Starting from a voxel seed, the algorithm selects the largest connected area that contains the voxel itself and all voxels with gray values lying inside an input range.
The input range is specified with the thresholdRange parameter.

This algorithm can be used to implement, for instance, an interactive magic wand tool.

See also

Function Syntax

This function returns outputBinaryImage.
// Function prototype
std::shared_ptr< iolink::ImageView > floodFillThreshold3d( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector3i32 seedPoint, iolink::Vector2d thresholdRange, std::shared_ptr< iolink::ImageView > outputBinaryImage = NULL );
This function returns outputBinaryImage.
// Function prototype.
flood_fill_threshold_3d( input_image,
                         seed_point = [1, 1, 1],
                         threshold_range = [128, 255],
                         output_binary_image = None )
This function returns outputBinaryImage.
// Function prototype.
public static IOLink.ImageView
FloodFillThreshold3d( IOLink.ImageView inputImage,
                      int[] seedPoint = null,
                      double[] thresholdRange = null,
                      IOLink.ImageView outputBinaryImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input grayscale image. Image Binary, Label or Grayscale nullptr
input
seedPoint
The seed point coordinates. Vector3i32 >=0 {1, 1, 1}
input
thresholdRange
The low and high threshold levels defining the input range. Vector2d Any value {128.f, 255.f}
output
outputBinaryImage
The output binary image. Its dimensions are forced to the same values as the input image. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input grayscale image. image Binary, Label or Grayscale None
input
seed_point
The seed point coordinates. vector3i32 >=0 [1, 1, 1]
input
threshold_range
The low and high threshold levels defining the input range. vector2d Any value [128, 255]
output
output_binary_image
The output binary image. Its dimensions are forced to the same values as the input image. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input grayscale image. Image Binary, Label or Grayscale null
input
seedPoint
The seed point coordinates. Vector3i32 >=0 {1, 1, 1}
input
thresholdRange
The low and high threshold levels defining the input range. Vector2d Any value {128f, 255f}
output
outputBinaryImage
The output binary image. Its dimensions are forced to the same values as the input image. Image null

Object Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

FloodFillThreshold3d floodFillThreshold3dAlgo;
floodFillThreshold3dAlgo.setInputImage( foam );
floodFillThreshold3dAlgo.setSeedPoint( {1, 1, 1} );
floodFillThreshold3dAlgo.setThresholdRange( {128.0, 255.0} );
floodFillThreshold3dAlgo.execute();

std::cout << "outputBinaryImage:" << floodFillThreshold3dAlgo.outputBinaryImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

flood_fill_threshold_3d_algo = imagedev.FloodFillThreshold3d()
flood_fill_threshold_3d_algo.input_image = foam
flood_fill_threshold_3d_algo.seed_point = [1, 1, 1]
flood_fill_threshold_3d_algo.threshold_range = [128.0, 255.0]
flood_fill_threshold_3d_algo.execute()

print( "output_binary_image:", str( flood_fill_threshold_3d_algo.output_binary_image ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

FloodFillThreshold3d floodFillThreshold3dAlgo = new FloodFillThreshold3d
{
    inputImage = foam,
    seedPoint = new int[]{1, 1, 1},
    thresholdRange = new double[]{128.0, 255.0}
};
floodFillThreshold3dAlgo.Execute();

Console.WriteLine( "outputBinaryImage:" + floodFillThreshold3dAlgo.outputBinaryImage.ToString() );

Function Examples

auto foam = readVipImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "foam.vip" );

auto result = floodFillThreshold3d( foam, {1, 1, 1}, {128.0, 255.0} );

std::cout << "outputBinaryImage:" << result->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

result = imagedev.flood_fill_threshold_3d( foam, [1, 1, 1], [128.0, 255.0] )

print( "output_binary_image:", str( result ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

IOLink.ImageView result = Processing.FloodFillThreshold3d( foam, new int[]{1, 1, 1}, new double[]{128.0, 255.0} );

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