IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Put a 2d image in a 3d imageSee full documentation
imageputSlice3dImg (inImg3d,inImg2d,axis,sliceIndex)

Detailed Description

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:

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:

putSlice3dImg.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.putSlice3dImg(inImg, sliceImg, PyIPSDK.eA_X, 1)

Example of C++ code :

Example informations

Header file

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

Code Example

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