Processing math: 100%
ImageDev

GetSliceFromVolume3d

Extracts a slice orthogonal to an axis of a 3D volume.

Access to parameter description

The GetSliceFromVolume3d algorithm extracts a slice from a plane of a 3D image. This plane can be orthogonal to the X, Y, or Z axis.
The 2D image is created with dimensions deduced from the volume dimensions and the selected axis:
Selected AxisPlanegxsgysXYZgyvgzvYXZgxvgzvZXYgxvgyv Where (gxv,gyv,gzv) is the input volume size in voxels for the X, Y, and Z directions and (gxs,gys) is the output slice size in pixels for the X and Y directions.

See also

Function Syntax

This function returns outputImage.
// Function prototype
std::shared_ptr< iolink::ImageView > getSliceFromVolume3d( std::shared_ptr< iolink::ImageView > inputImage, GetSliceFromVolume3d::Axis axis, int32_t sliceIndex, std::shared_ptr< iolink::ImageView > outputImage = NULL );

Class Syntax

Parameters

Parameter Name Description Type Supported Values Default Value
input
inputImage
The input 3D image (the volume from which the slice is extracted). Image Binary, Label, Grayscale or Multispectral nullptr
input
axis
The axis orthogonal to the plane to extract.
X_AXIS This mode extracts a plane orthogonal to X axis.
Y_AXIS This mode extracts a plane orthogonal to Y axis.
Z_AXIS This mode extracts a plane orthogonal to Z axis.
Enumeration Z_AXIS
input
sliceIndex
The axis index of the plane to extract. Int32 >=0 1
output
outputImage
The output 2D image (the extracted slice). Image nullptr

Object Examples

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

GetSliceFromVolume3d getSliceFromVolume3dAlgo;
getSliceFromVolume3dAlgo.setInputImage( foam );
getSliceFromVolume3dAlgo.setAxis( GetSliceFromVolume3d::Axis::X_AXIS );
getSliceFromVolume3dAlgo.setSliceIndex( 1 );
getSliceFromVolume3dAlgo.execute();

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

Function Examples

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

auto result = getSliceFromVolume3d( foam, GetSliceFromVolume3d::Axis::X_AXIS, 1 );

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