The ConvertImage algorithm changes the arithmetic format of the input image to an output image.
Conversion follows the C convention, and no overflow is checked.
When converting to a binary image type, non-zero gray level values are changed to 1, and zero gray
level values stay unchanged.
The type of the output image is set by an enumerate as detailed in the
Data Type Management section.
The available formats are:
8-bit unsigned integer
8-bit signed integer
16-bit unsigned integer
16-bit signed integer
32-bit unsigned integer
32-bit signed integer
32-bit real floating-point
64-bit real floating-point
32-bit complex floating-point
64-bit complex floating-point
Binary
8-bit label
16-bit label
32-bit label
For conversion from Scalar to Complex, the imaginary part is set to 0 and the real part to the value of the input image.
For conversion from Complex to Scalar, the output is set to the real part of the input image.
Note: The complex is mainly for internal usage. Most of ImageDev algorithms do not acccept a complex image as input for now.
// Function prototype.publicstaticIOLink.ImageViewConvertImage(IOLink.ImageView inputImage,ConvertImage.OutputType outputType =ImageDev.ConvertImage.OutputType.SIGNED_INTEGER_16_BIT,IOLink.ImageView outputImage =null);
Class Syntax
// Command constructor.ConvertImage();/// Gets the inputImage parameter./// The input image.
std::shared_ptr< iolink::ImageView> inputImage()const;/// Sets the inputImage parameter./// The input image.void setInputImage( std::shared_ptr< iolink::ImageView> inputImage );/// Gets the outputType parameter./// The output image data type.ConvertImage::OutputType outputType()const;/// Sets the outputType parameter./// The output image data type.void setOutputType(constConvertImage::OutputType& outputType );/// Gets the outputImage parameter./// The output image.
std::shared_ptr< iolink::ImageView> outputImage()const;/// Sets the outputImage parameter./// The output image.void setOutputImage( std::shared_ptr< iolink::ImageView> outputImage );// Method to launch the command.void execute();
# Property of the inputImage parameter.ConvertImage.input_image
# Property of the outputType parameter.ConvertImage.output_type
# Property of the outputImage parameter.ConvertImage.output_image
// Method to launch the command.
execute()
// Command constructor.ConvertImage()// Property of the inputImage parameter.ConvertImage.inputImage
// Property of the outputType parameter.ConvertImage.outputType
// Property of the outputImage parameter.ConvertImage.outputImage
// Method to launch the command.Execute()
Parameters
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image.
Image
Binary, Label, Grayscale or Multispectral
nullptr
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.
UNSIGNED_INTEGER_16_BIT
The output image data type is 2 bytes depth. Its possible intensities are unsigned integer from 0 to 65,535.
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_32_BIT
The output image data type is 4 bytes depth. Its possible intensities are unsigned integer from 0 to 4,294,967,295.
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 signed floating-point from -3.402823E38 to 3.402823E38.
FLOAT_64_BIT
The output image data type is 8 bytes depth. Its possible intensities are signed floating-point from -1.797693E308 to 1.797693E308.
COMPLEX_FLOAT_32_BIT
The output image data type is a complex of two 32-bit real floating-point.
COMPLEX_FLOAT_64_BIT
The output image data type is a complex of two 64-bit real floating-point.
BINARY
The output image data type is 1 byte depth and interpretation is binary. Its possible intensities are unsigned integer from 0 to 1.
LABEL_8_BIT
The output image data type is 1 byte depth and interpretation is label. Its possible intensities are unsigned integer from 0 to 255.
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.
LABEL_32_BIT
The output image data type is 4 bytes depth and interpretation is label. Its possible intensities are unsigned integer from 0 to 4,294,967,295.
Enumeration
SIGNED_INTEGER_16_BIT
outputImage
The output image.
Image
nullptr
Parameter Name
Description
Type
Supported Values
Default Value
input_image
The input image.
image
Binary, Label, Grayscale or Multispectral
None
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.
UNSIGNED_INTEGER_16_BIT
The output image data type is 2 bytes depth. Its possible intensities are unsigned integer from 0 to 65,535.
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_32_BIT
The output image data type is 4 bytes depth. Its possible intensities are unsigned integer from 0 to 4,294,967,295.
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 signed floating-point from -3.402823E38 to 3.402823E38.
FLOAT_64_BIT
The output image data type is 8 bytes depth. Its possible intensities are signed floating-point from -1.797693E308 to 1.797693E308.
COMPLEX_FLOAT_32_BIT
The output image data type is a complex of two 32-bit real floating-point.
COMPLEX_FLOAT_64_BIT
The output image data type is a complex of two 64-bit real floating-point.
BINARY
The output image data type is 1 byte depth and interpretation is binary. Its possible intensities are unsigned integer from 0 to 1.
LABEL_8_BIT
The output image data type is 1 byte depth and interpretation is label. Its possible intensities are unsigned integer from 0 to 255.
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.
LABEL_32_BIT
The output image data type is 4 bytes depth and interpretation is label. Its possible intensities are unsigned integer from 0 to 4,294,967,295.
enumeration
SIGNED_INTEGER_16_BIT
output_image
The output image.
image
None
Parameter Name
Description
Type
Supported Values
Default Value
inputImage
The input image.
Image
Binary, Label, Grayscale or Multispectral
null
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.
UNSIGNED_INTEGER_16_BIT
The output image data type is 2 bytes depth. Its possible intensities are unsigned integer from 0 to 65,535.
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_32_BIT
The output image data type is 4 bytes depth. Its possible intensities are unsigned integer from 0 to 4,294,967,295.
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 signed floating-point from -3.402823E38 to 3.402823E38.
FLOAT_64_BIT
The output image data type is 8 bytes depth. Its possible intensities are signed floating-point from -1.797693E308 to 1.797693E308.
COMPLEX_FLOAT_32_BIT
The output image data type is a complex of two 32-bit real floating-point.
COMPLEX_FLOAT_64_BIT
The output image data type is a complex of two 64-bit real floating-point.
BINARY
The output image data type is 1 byte depth and interpretation is binary. Its possible intensities are unsigned integer from 0 to 1.
LABEL_8_BIT
The output image data type is 1 byte depth and interpretation is label. Its possible intensities are unsigned integer from 0 to 255.
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.
LABEL_32_BIT
The output image data type is 4 bytes depth and interpretation is label. Its possible intensities are unsigned integer from 0 to 4,294,967,295.