ImageDev

RescaleImage3d

Generates a three-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 Resize3d instead.

This algorithm resamples a 3D 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 > rescaleImage3d( std::shared_ptr< iolink::ImageView > inputImage, int32_t imageSizeX, int32_t imageSizeY, int32_t imageSizeZ, RescaleImage3d::InterpolationType interpolationType, std::shared_ptr< iolink::ImageView > outputImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
imageSizeX
The X size of the new image, in pixels. Int32 >=1 1024
input
imageSizeY
The Y size of the new image, in pixels. Int32 >=1 1024
input
imageSizeZ
The Z size of the new image, in pixels. Int32 >=1 256
input
inputImage
The input grayscale image. Image Binary, Label, Grayscale or Multispectral nullptr
input
interpolationType
The interpolation mode. Method used to calculate the intensity of each result pixel
NEAREST_NEIGHBOR Assign the gray level of the nearest pixel.
LINEAR Assign the bilinear interpolation from the four nearest pixels.
SPLINE Assign the cubic interpolation from the nearest pixels.
Enumeration NEAREST_NEIGHBOR
output
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

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

RescaleImage3d rescaleImage3dAlgo;
rescaleImage3dAlgo.setInputImage( foam );
rescaleImage3dAlgo.setImageSizeX( 128 );
rescaleImage3dAlgo.setImageSizeY( 128 );
rescaleImage3dAlgo.setImageSizeZ( 128 );
rescaleImage3dAlgo.setInterpolationType( RescaleImage3d::InterpolationType::NEAREST_NEIGHBOR );
rescaleImage3dAlgo.execute();

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

Function Examples

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

auto result = rescaleImage3d( foam, 128, 128, 128, RescaleImage3d::InterpolationType::NEAREST_NEIGHBOR );

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