ImageDev

Resize3d

Generates a three-dimensional image with a new size using a user-defined interpolation mode.

Access to parameter description

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 > resize3d( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector3i32 shape, Resize3d::InterpolationType interpolationType, std::shared_ptr< iolink::ImageView > outputImage = NULL );
This function returns outputImage.
// Function prototype.
resize_3d( input_image,
           shape = [512, 512, 512],
           interpolation_type = Resize3d.InterpolationType.NEAREST_NEIGHBOR,
           output_image = None )
This function returns outputImage.
// Function prototype.
public static IOLink.ImageView
Resize3d( IOLink.ImageView inputImage,
          int[] shape = null,
          Resize3d.InterpolationType interpolationType = ImageDev.Resize3d.InterpolationType.NEAREST_NEIGHBOR,
          IOLink.ImageView outputImage = null );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral nullptr
input
shape
The X, Y and Z size of the new image, in pixels. Vector3i32 >0 {512, 512, 512}
input
interpolationType
The interpolation mode. Method used to calculate the intensity of each pixel in the result image.
NEAREST_NEIGHBOR Assign the gray level of the nearest pixel.
LINEAR Assign the bilinear interpolation from the four nearest pixels.
Enumeration NEAREST_NEIGHBOR
output
outputImage
The output image. Its type is forced to the same value as the input. Its dimensions are defined by the shape parameter. Image nullptr
Parameter Name Description Type Supported Values Default Value
input
input_image
The input image. image Binary, Label, Grayscale or Multispectral None
input
shape
The X, Y and Z size of the new image, in pixels. vector3i32 >0 [512, 512, 512]
input
interpolation_type
The interpolation mode. Method used to calculate the intensity of each pixel in the result image.
NEAREST_NEIGHBOR Assign the gray level of the nearest pixel.
LINEAR Assign the bilinear interpolation from the four nearest pixels.
enumeration NEAREST_NEIGHBOR
output
output_image
The output image. Its type is forced to the same value as the input. Its dimensions are defined by the shape parameter. image None
Parameter Name Description Type Supported Values Default Value
input
inputImage
The input image. Image Binary, Label, Grayscale or Multispectral null
input
shape
The X, Y and Z size of the new image, in pixels. Vector3i32 >0 {512, 512, 512}
input
interpolationType
The interpolation mode. Method used to calculate the intensity of each pixel in the result image.
NEAREST_NEIGHBOR Assign the gray level of the nearest pixel.
LINEAR Assign the bilinear interpolation from the four nearest pixels.
Enumeration NEAREST_NEIGHBOR
output
outputImage
The output image. Its type is forced to the same value as the input. Its dimensions are defined by the shape parameter. Image null

Object Examples

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

Resize3d resize3dAlgo;
resize3dAlgo.setInputImage( foam );
resize3dAlgo.setShape( {512, 512, 512} );
resize3dAlgo.setInterpolationType( Resize3d::InterpolationType::NEAREST_NEIGHBOR );
resize3dAlgo.execute();

std::cout << "outputImage:" << resize3dAlgo.outputImage()->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

resize_3d_algo = imagedev.Resize3d()
resize_3d_algo.input_image = foam
resize_3d_algo.shape = [512, 512, 512]
resize_3d_algo.interpolation_type = imagedev.Resize3d.NEAREST_NEIGHBOR
resize_3d_algo.execute()

print( "output_image:", str( resize_3d_algo.output_image ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

Resize3d resize3dAlgo = new Resize3d
{
    inputImage = foam,
    shape = new int[]{512, 512, 512},
    interpolationType = Resize3d.InterpolationType.NEAREST_NEIGHBOR
};
resize3dAlgo.Execute();

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

Function Examples

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

auto result = resize3d( foam, {512, 512, 512}, Resize3d::InterpolationType::NEAREST_NEIGHBOR );

std::cout << "outputImage:" << result->toString();
foam = imagedev.read_vip_image(imagedev_data.get_image_path("foam.vip"))

result = imagedev.resize_3d( foam, [512, 512, 512], imagedev.Resize3d.NEAREST_NEIGHBOR )

print( "output_image:", str( result ) )
ImageView foam = Data.ReadVipImage( @"Data/images/foam.vip" );

IOLink.ImageView result = Processing.Resize3d( foam, new int[]{512, 512, 512}, Resize3d.InterpolationType.NEAREST_NEIGHBOR );

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