image = | putSlice3dImg (inImg3d,inImg2d,axis,sliceIndex) |
Copies a 2D image in a 3D image as a slice in the input slice index along x, y or z.
The result of this algorithm is the 3D input image, but with the 2D input image copied 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
Please, remember that the 2D image size must fit the 3D image size in the appropriate direction.
Here is an example of a 3d image is copied in a 3D volume containing geometric objects on each axis:
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLUtility as util
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
outImg = util.putSlice3dImg(inImg, sliceImg, PyIPSDK.eA_X, 1)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLUtility/Processor/PutSlice3dImg/PutSlice3dImg.h>
Code Example
ImagePtr pOutImgZ = putSlice3dImg(pInImg3d, pInImg2dZ,
eAxis::eA_Z, 1);
ImagePtr pOutImgY = putSlice3dImg(pInImg3d, pInImg2dY,
eAxis::eA_Y, 100);
ImagePtr pOutImgX = putSlice3dImg(pInImg3d, pInImg2dX,
eAxis::eA_X, 100);