Processing math: 100%
ImageDev

CropImage3d

Extracts a three-dimensional rectangular region from an image.

Access to parameter description

CropImage3d copies a rectangular area, defined by an origin and a size in voxels, from an input image I and creates an output image O from this selected region.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > cropImage3d( std::shared_ptr< iolink::ImageView > inputImage, iolink::Vector3i32 areaOrigin, iolink::Vector3i32 areaSize, std::shared_ptr< 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
areaOrigin
The origin of the area (the X, Y, and Z voxel coordinates of the input image corresponding to the output image origin). Vector3i32 >=0 {1, 1, 1}
input
areaSize
The size, in voxels, of the area (the X, Y, and Z dimensions of the output image). Vector3i32 >0 {100, 100, 100}
output
outputImage
The output image. Image nullptr

Object Examples

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

CropImage3d cropImage3dAlgo;
cropImage3dAlgo.setInputImage( foam );
cropImage3dAlgo.setAreaOrigin( {1, 1, 1} );
cropImage3dAlgo.setAreaSize( {100, 100, 100} );
cropImage3dAlgo.execute();

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

Function Examples

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

auto result = cropImage3d( foam, {1, 1, 1}, {100, 100, 100} );

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