RescaleImage2d
Generates a two-dimensional image with a new size using a user-defined interpolation mode.
Access to parameter description
This command is deprecated, it will be removed in ImageDev 2024.2.
You can use Resize2d instead.
This algorithm resamples a 2D image to generate a new image with a different size by applying a user-defined interpolation mode.
See also
Access to parameter description
This command is deprecated, it will be removed in ImageDev 2024.2.
You can use Resize2d instead.
This algorithm resamples a 2D image to generate a new image with a different size by applying a user-defined interpolation mode.
See also
Function Syntax
This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > rescaleImage2d( std::shared_ptr< iolink::ImageView > inputImage, int32_t imageSizeX, int32_t imageSizeY, RescaleImage2d::InterpolationType interpolationType, std::shared_ptr< iolink::ImageView > outputImage = NULL );
Class Syntax
Parameters
Parameter Name | Description | Type | Supported Values | Default Value | |||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
imageSizeX |
The X size of the new image, in pixels. | Int32 | >=1 | 1024 | ||||||
![]() |
imageSizeY |
The Y size of the new image, in pixels. | Int32 | >=1 | 1024 | ||||||
![]() |
inputImage |
The input image. | Image | Binary, Label, Grayscale or Multispectral | nullptr | ||||||
![]() |
interpolationType |
The interpolation mode. Method used to calculate the intensity of each pixel in the result image.
|
Enumeration | NEAREST_NEIGHBOR | |||||||
![]() |
outputImage |
The output image. Its type is forced to the same value as the input. Its dimensions depend on the image size parameters. | Image | nullptr |
Object Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); RescaleImage2d rescaleImage2dAlgo; rescaleImage2dAlgo.setInputImage( polystyrene ); rescaleImage2dAlgo.setImageSizeX( 256 ); rescaleImage2dAlgo.setImageSizeY( 256 ); rescaleImage2dAlgo.setInterpolationType( RescaleImage2d::InterpolationType::NEAREST_NEIGHBOR ); rescaleImage2dAlgo.execute(); std::cout << "outputImage:" << rescaleImage2dAlgo.outputImage()->toString();
Function Examples
std::shared_ptr< iolink::ImageView > polystyrene = ioformat::readImage( std::string( IMAGEDEVDATA_IMAGES_FOLDER ) + "polystyrene.tif" ); auto result = rescaleImage2d( polystyrene, 256, 256, RescaleImage2d::InterpolationType::NEAREST_NEIGHBOR ); std::cout << "outputImage:" << result->toString();