IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Get a slice from a 3d imageSee full documentation
imagegetSlice3dImg (inImg3d,axis,sliceIndex)

Detailed Description

Creates a 2D image from a slice along a given axis (x, y, or z) of a 3D image.

The result of this algorithm is a 2D extracted along the direction InAxis from the input 3D image in the slice InSliceIndex of the 3D output image.

The InAxis parameter indicates the direction of the copy:

Here is an example of a lice extraction from a 3d image along each axis:

getSlice3dImg.png

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLUtility as util

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
outImg = util.getSlice3dImg(inImg, PyIPSDK.eA_X, 100)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLUtility/Processor/GetSlice3dImg/GetSlice3dImg.h>

Code Example

// Extract a XY slice along the z-axis at z=1
ImagePtr pOutImgZ = getSlice3dImg(pInImg3d, eAxis::eA_Z, 1);
// Extract a XZ slice along the y-axis at y=100
ImagePtr pOutImgY = getSlice3dImg(pInImg3d, eAxis::eA_Y, 100);
// Extract a YZ slice along the x-axis at x=100
ImagePtr pOutImgX = getSlice3dImg(pInImg3d, eAxis::eA_X, 100);