image = | getSlice3dImg (inImg3d,axis,sliceIndex) |
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:
- the x-direction will result in a y-z slice
- the y-direction will result in a x-z slice
- the z-direction will result in a x-y slice
Here is an example of a lice extraction from a 3d image along each axis:
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLUtility as util
Code Example
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
ImagePtr pOutImgZ = getSlice3dImg(pInImg3d,
eAxis::eA_Z, 1);
ImagePtr pOutImgY = getSlice3dImg(pInImg3d,
eAxis::eA_Y, 100);
ImagePtr pOutImgX = getSlice3dImg(pInImg3d,
eAxis::eA_X, 100);