IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Copies a 2D image in a 3D image as a slice in the input slice index along x, y or z. More...

IPSDKIPLUTILITY_API ipsdk::image::ImagePtr ipsdk::imaproc::util::putSlice3dImg (const image::ImageConstPtr &pInImg3d, const image::ImageConstPtr &pInImg2d, const ipsdk::imaproc::attr::eAxis &axis, const ipUInt64 sliceIndex)
 wrapper function for Copies a 2D image in a 3D image as a slice in the input slice index along x, y or z More...
 
IPSDKIPLUTILITY_API void ipsdk::imaproc::util::putSlice3dImg (const image::ImageConstPtr &pInImg3d, const image::ImageConstPtr &pInImg2d, const ipsdk::imaproc::attr::eAxis &axis, const ipUInt64 sliceIndex, const image::ImagePtr &pOutImg)
 wrapper function for Copies a 2D image in a 3D image as a slice in the input slice index along x, y or z More...
 

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InImg2d [Input] 2d image for operation X
ipsdk::imaproc::attr::InAxis [Input] Indicates the axis to process X
ipsdk::imaproc::attr::InSliceIndex [Input] Index of the slice to process X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation ipsdk::imaproc::duplicateInOut (_pOutImg, _pInImg3d)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSizeAndType (_pInImg3d,_pOutImg) && 
ipsdk::imaproc::customImageProperty (_pInImg2d,
 ipsdk::imaproc::util::matchSlice (_pInImg2d,_pInImg3d,_pInAxis))

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

Associated library

IPSDKIPLUtility

Header file

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);
See also
PutSlice3dImgLvl1
PutSlice3dImgLvl2
PutSlice3dImgLvl3

Function Documentation

◆ putSlice3dImg() [1/2]

IPSDKIPLUTILITY_API ipsdk::image::ImagePtr ipsdk::imaproc::util::putSlice3dImg ( const image::ImageConstPtr pInImg3d,
const image::ImageConstPtr pInImg2d,
const ipsdk::imaproc::attr::eAxis axis,
const ipUInt64  sliceIndex 
)

wrapper function for Copies a 2D image in a 3D image as a slice in the input slice index along x, y or z

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ putSlice3dImg() [2/2]

IPSDKIPLUTILITY_API void ipsdk::imaproc::util::putSlice3dImg ( const image::ImageConstPtr pInImg3d,
const image::ImageConstPtr pInImg2d,
const ipsdk::imaproc::attr::eAxis axis,
const ipUInt64  sliceIndex,
const image::ImagePtr pOutImg 
)

wrapper function for Copies a 2D image in a 3D image as a slice in the input slice index along x, y or z

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure