IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

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

IPSDKIPLUTILITY_API ipsdk::image::ImagePtr ipsdk::imaproc::util::getSlice3dImg (const image::ImageConstPtr &pInImg3d, const ipsdk::imaproc::attr::eAxis &axis, const ipUInt64 sliceIndex)
 wrapper function for Creates a 2D image from a slice along a given axis (x, y, or z) of a 3D image More...
 
IPSDKIPLUTILITY_API void ipsdk::imaproc::util::getSlice3dImg (const image::ImageConstPtr &pInImg3d, const ipsdk::imaproc::attr::eAxis &axis, const ipUInt64 sliceIndex, const image::ImagePtr &pOutImg)
 wrapper function for Creates a 2D image from a slice along a given axis (x, y, or z) of a 3D image More...
 

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d 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::OutImg2d [Output] 2d image for processing operation customOutput (_pOutImg2d, outputSlice(_pInImg3d,_pInAxis))

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchBufferType (_pInImg3d,_pOutImg2d) && 
ipsdk::imaproc::customImageProperty (_pOutImg2d,
 ipsdk::imaproc::util::matchSlice (_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.getSlice3dImg(inImg, PyIPSDK.eA_X, 100)

Example of C++ code :

Example informations

Associated library

IPSDKIPLUtility

Header file

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);
See also
GetSlice3dImgLvl1
GetSlice3dImgLvl2
GetSlice3dImgLvl3

Function Documentation

◆ getSlice3dImg() [1/2]

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

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

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ getSlice3dImg() [2/2]

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

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

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure