ImageDev

RandomImage3d

Creates a new three-dimensional image with random values having an equidistribution.

Access to parameter description

RandomImage3d creates an image with random values that follow a uniform distribution.
The output image intensity values are included in the range $\left[Mean-\frac{Range}{2}~..~Mean+\frac{Range}{2}\right]$.
Where $Mean$ and $Range$ are input parameters of the algorithm.
The image histogram is flat, which means that each intensity has an equiprobability to occur.

The type of the output image is set by an enumerate as detailed in the Data Type Management section.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > randomImage3d( RandomImage3d::OutputType outputType, int32_t imageSizeX, int32_t imageSizeY, int32_t imageSizeZ, double mean, double range, std::shared_ptr< iolink::ImageView > outputImage = nullptr );
This function returns outputImage.
// Function prototype.
random_image_3d(output_type: RandomImage3d.OutputType = RandomImage3d.OutputType.UNSIGNED_INTEGER_8_BIT,
                image_size_x: int = 1024,
                image_size_y: int = 1024,
                image_size_z: int = 256,
                mean: float = 80,
                range: float = 10,
                output_image: idt.ImageType = None) -> idt.ImageType
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
RandomImage3d( RandomImage3d.OutputType outputType = ImageDev.RandomImage3d.OutputType.UNSIGNED_INTEGER_8_BIT,
               Int32 imageSizeX = 1024,
               Int32 imageSizeY = 1024,
               Int32 imageSizeZ = 256,
               double mean = 80,
               double range = 10,
               IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
imageSizeX
The X size in pixels of the output image. Int32 >=1 1024
input
imageSizeY
The Y size in pixels of the output image. Int32 >=1 1024
input
imageSizeZ
The Z size in pixels of the output image. Int32 >=1 256
input
outputType
The output image data type.
UNSIGNED_INTEGER_8_BIT The output image data type is 1 byte depth. Its possible intensities are unsigned integer from 0 to 255.
SIGNED_INTEGER_8_BIT The output image data type is 1 byte depth. Its possible intensities are signed integer from -128 to 127.
SIGNED_INTEGER_16_BIT The output image data type is 2 bytes depth. Its possible intensities are signed integer from -32,768 to 32,767.
UNSIGNED_INTEGER_16_BIT The output image data type is 2 bytes depth. Its possible intensities are unsigned integer from 0 to 65,535.
LABEL_16_BIT The output image data type is 2 bytes depth and interpretation is label. Its possible intensities are unsigned integer from 0 to 65,535.
BINARY The output image data type is 2 bytes depth and interpretation is binary. Its possible intensities are unsigned integer from 0 to 1.
SIGNED_INTEGER_32_BIT The output image data type is 4 bytes depth. Its possible intensities are signed integer from -2,147,483,648 to 2,147,483,647.
FLOAT_32_BIT The output image data type is 4 bytes depth. Its possible intensities are unsigned floating-point from -3.402823E38 to 3.402823E38.
Enumeration UNSIGNED_INTEGER_8_BIT
input
mean
The mean of random values. Float64 Any value 80
input
range
The output intensity range of random values. Float64 >0 10
output
outputImage
The output image. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
image_size_x
The X size in pixels of the output image. int32 >=1 1024
input
image_size_y
The Y size in pixels of the output image. int32 >=1 1024
input
image_size_z
The Z size in pixels of the output image. int32 >=1 256
input
output_type
The output image data type.
UNSIGNED_INTEGER_8_BIT The output image data type is 1 byte depth. Its possible intensities are unsigned integer from 0 to 255.
SIGNED_INTEGER_8_BIT The output image data type is 1 byte depth. Its possible intensities are signed integer from -128 to 127.
SIGNED_INTEGER_16_BIT The output image data type is 2 bytes depth. Its possible intensities are signed integer from -32,768 to 32,767.
UNSIGNED_INTEGER_16_BIT The output image data type is 2 bytes depth. Its possible intensities are unsigned integer from 0 to 65,535.
LABEL_16_BIT The output image data type is 2 bytes depth and interpretation is label. Its possible intensities are unsigned integer from 0 to 65,535.
BINARY The output image data type is 2 bytes depth and interpretation is binary. Its possible intensities are unsigned integer from 0 to 1.
SIGNED_INTEGER_32_BIT The output image data type is 4 bytes depth. Its possible intensities are signed integer from -2,147,483,648 to 2,147,483,647.
FLOAT_32_BIT The output image data type is 4 bytes depth. Its possible intensities are unsigned floating-point from -3.402823E38 to 3.402823E38.
enumeration UNSIGNED_INTEGER_8_BIT
input
mean
The mean of random values. float64 Any value 80
input
range
The output intensity range of random values. float64 >0 10
output
output_image
The output image. image None
Parameter Name Description Type Supported Values Default Value
input
imageSizeX
The X size in pixels of the output image. Int32 >=1 1024
input
imageSizeY
The Y size in pixels of the output image. Int32 >=1 1024
input
imageSizeZ
The Z size in pixels of the output image. Int32 >=1 256
input
outputType
The output image data type.
UNSIGNED_INTEGER_8_BIT The output image data type is 1 byte depth. Its possible intensities are unsigned integer from 0 to 255.
SIGNED_INTEGER_8_BIT The output image data type is 1 byte depth. Its possible intensities are signed integer from -128 to 127.
SIGNED_INTEGER_16_BIT The output image data type is 2 bytes depth. Its possible intensities are signed integer from -32,768 to 32,767.
UNSIGNED_INTEGER_16_BIT The output image data type is 2 bytes depth. Its possible intensities are unsigned integer from 0 to 65,535.
LABEL_16_BIT The output image data type is 2 bytes depth and interpretation is label. Its possible intensities are unsigned integer from 0 to 65,535.
BINARY The output image data type is 2 bytes depth and interpretation is binary. Its possible intensities are unsigned integer from 0 to 1.
SIGNED_INTEGER_32_BIT The output image data type is 4 bytes depth. Its possible intensities are signed integer from -2,147,483,648 to 2,147,483,647.
FLOAT_32_BIT The output image data type is 4 bytes depth. Its possible intensities are unsigned floating-point from -3.402823E38 to 3.402823E38.
Enumeration UNSIGNED_INTEGER_8_BIT
input
mean
The mean of random values. Float64 Any value 80
input
range
The output intensity range of random values. Float64 >0 10
output
outputImage
The output image. Image null

Object Examples


RandomImage3d randomImage3dAlgo;
randomImage3dAlgo.setOutputType( RandomImage3d::OutputType::UNSIGNED_INTEGER_8_BIT );
randomImage3dAlgo.setImageSizeX( 128 );
randomImage3dAlgo.setImageSizeY( 128 );
randomImage3dAlgo.setImageSizeZ( 128 );
randomImage3dAlgo.setMean( 80.0 );
randomImage3dAlgo.setRange( 10.0 );
randomImage3dAlgo.execute();

std::cout << "outputImage:" << randomImage3dAlgo.outputImage()->toString();

random_image_3d_algo = imagedev.RandomImage3d()
random_image_3d_algo.output_type = imagedev.RandomImage3d.UNSIGNED_INTEGER_8_BIT
random_image_3d_algo.image_size_x = 128
random_image_3d_algo.image_size_y = 128
random_image_3d_algo.image_size_z = 128
random_image_3d_algo.mean = 80.0
random_image_3d_algo.range = 10.0
random_image_3d_algo.execute()

print("output_image:", str(random_image_3d_algo.output_image))

RandomImage3d randomImage3dAlgo = new RandomImage3d
{
    outputType = RandomImage3d.OutputType.UNSIGNED_INTEGER_8_BIT,
    imageSizeX = 128,
    imageSizeY = 128,
    imageSizeZ = 128,
    mean = 80.0,
    range = 10.0
};
randomImage3dAlgo.Execute();

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

Function Examples


auto result = randomImage3d( RandomImage3d::OutputType::UNSIGNED_INTEGER_8_BIT, 128, 128, 128, 80.0, 10.0 );

std::cout << "outputImage:" << result->toString();

result = imagedev.random_image_3d(imagedev.RandomImage3d.UNSIGNED_INTEGER_8_BIT, 128, 128, 128, 80.0, 10.0)

print("output_image:", str(result))

IOLink.ImageView result = Processing.RandomImage3d( RandomImage3d.OutputType.UNSIGNED_INTEGER_8_BIT, 128, 128, 128, 80.0, 10.0 );

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