RandomSphereImage3d
Creates synthetic spheres in a binary image.
Access to parameter description
The RandomSphereImage3d algorithm creates a binary image containing a random distribution of spheres. The sphere radius range, distance, type of distribution, and number are parameters of the algorithm.
The following image is an example of the result with the default parameters:

Figure 1. Generation of 5 spheres
See also
Access to parameter description
The RandomSphereImage3d algorithm creates a binary image containing a random distribution of spheres. The sphere radius range, distance, type of distribution, and number are parameters of the algorithm.
The following image is an example of the result with the default parameters:

Figure 1. Generation of 5 spheres
See also
Function Syntax
This function returns outputBinaryImage.
// Function prototype
std::shared_ptr< iolink::ImageView > randomSphereImage3d( iolink::Vector3i32 imageSize, int32_t sphereNumber, RandomSphereImage3d::Distribution distribution, iolink::Vector2i32 radiusRange, int32_t distance, std::shared_ptr< iolink::ImageView > outputBinaryImage = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||
---|---|---|---|---|---|---|---|---|---|
![]() |
imageSize |
The X, Y, and Z size in voxels of the output image. | Vector3i32 | >0 | {100, 100, 100} | ||||
![]() |
sphereNumber |
The number of spheres to generate. | Int32 | >=1 | 5 | ||||
![]() |
distribution |
The distribution type of the sphere radii.
|
Enumeration | UNIFORM | |||||
![]() |
radiusRange |
The minimum and maximum radius in voxels of the spheres (for Uniform distribution) or mean and standard deviation (for gaussian distribution). | Vector2i32 | Any value | {10, 20} | ||||
![]() |
distance |
The minimum distance between two sphere centers. | Int32 | >=0 | 40 | ||||
![]() |
outputBinaryImage |
The output 3D binary image. | Image | nullptr |
Object Examples
RandomSphereImage3d randomSphereImage3dAlgo; randomSphereImage3dAlgo.setImageSize( {100, 100, 100} ); randomSphereImage3dAlgo.setSphereNumber( 5 ); randomSphereImage3dAlgo.setDistribution( RandomSphereImage3d::Distribution::UNIFORM ); randomSphereImage3dAlgo.setRadiusRange( {10, 20} ); randomSphereImage3dAlgo.setDistance( 40 ); randomSphereImage3dAlgo.execute(); std::cout << "outputBinaryImage:" << randomSphereImage3dAlgo.outputBinaryImage()->toString();
Function Examples
auto result = randomSphereImage3d( {100, 100, 100}, 5, RandomSphereImage3d::Distribution::UNIFORM, {10, 20}, 40 ); std::cout << "outputBinaryImage:" << result->toString();