IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Algorithm allowing to resize a 3d image. More...

IPSDKIPLGEOMETRICTRANSFORM_API image::ImagePtr ipsdk::imaproc::gtrans::zoom3dImg (const image::ImageConstPtr &pInImg, ipReal64 xZoomFactor, ipReal64 yZoomFactor, ipReal64 zZoomFactor, const ipsdk::imaproc::attr::eZoomInterpolationMethod &interpolationMethod)
 wrapper function for image 3d zoom algorithm More...
 
IPSDKIPLGEOMETRICTRANSFORM_API image::ImagePtr ipsdk::imaproc::gtrans::zoom3dImg (const image::ImageConstPtr &pInImg, ipReal64 zoomFactor, const ipsdk::imaproc::attr::eZoomInterpolationMethod &interpolationMethod)
 wrapper function for image 3d zoom algorithm More...
 
IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::zoom3dImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::eZoomInterpolationMethod &interpolationMethod, const image::ImagePtr &pOutImg)
 wrapper function for image 3d zoom algorithm More...
 
IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::zoom3dImg (const image::ImageConstPtr &pInImg, ipReal64 xZoomFactor, ipReal64 yZoomFactor, ipReal64 zZoomFactor, const ipsdk::imaproc::attr::eZoomInterpolationMethod &interpolationMethod, const image::ImagePtr &pOutImg)
 wrapper function for image 3d zoom algorithm More...
 

Detailed Description

Algorithm allowing to resize a 3d image.

This algorithm allows to resize a 3d image using one of the available interpolation methods
The user can resize a 3d image either to the expected output image size or by specifying the scale factors along the x, y and z axis.

If the user provides the buffer of the output image, he has to initialize its dimensions with the correct values. If the user requests a resize operation by specifying the scale factors, for instance, the dimensions of the output image must equal to:

The enumerate ipsdk::attr::eZoomInterpolationMethod permits to specify the interpolation method to use to resize the image. The following interpolation methods are available:

An example of image resizing is illustrated in 2d case : see 2d zoom.

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InZoomInterpolationMethod [Input] interpolation method for image zoom algorithms X
ipsdk::imaproc::attr::InOptOutputImg3dSize [Input Optional] expected output image 7d size X
ipsdk::imaproc::attr::InOptScaleFactor3d [Input Optional] 3d scale factor X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation customOutput (_pOutImg, outputZoom3d(_pInImg3d,_pInOptScaleFactor3d,_pInOptOutputImg3dSize))

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::noInSitu (_pInImg3d,_pOutImg) && 
ipsdk::processor::If (
 ipsdk::processor::isSet (_pInOptOutputImg3dSize),
 ipsdk::processor::Not (
  ipsdk::processor::isSet (_pInOptScaleFactor3d)),
 ipsdk::processor::isSet (_pInOptScaleFactor3d)) && 
ipsdk::imaproc::matchSize (eMatchImageSizeType::eMIST_CT,_pInImg3d,_pOutImg) && 
ipsdk::imaproc::customImageProperty (_pOutImg,
 matchZoom3d (_pInImg3d,_pInOptScaleFactor3d,_pInOptOutputImg3dSize))

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGeometricTransform as gtrans

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
xScaleFactor = 2.1
yScaleFactor = 1.2
zScaleFactor = 1.3
# initialization of output image
outImg3dSize = gtrans.getZoom3dOutputImageSize(PyIPSDK.createImg3dSize(inImg.getSizeX(), inImg.getSizeY(), inImg.getSizeZ()), PyIPSDK.createScaleFactor3d(xScaleFactor, yScaleFactor, zScaleFactor))
outImg3dSizeX = outImg3dSize.xSz
outImg3dSizeY = outImg3dSize.ySz
outImg3dSizeZ = outImg3dSize.zSz
outGeometry = PyIPSDK.geometry3d(inImg.getBufferType(), outImg3dSizeX, outImg3dSizeY, outImg3dSizeZ)
outImg = PyIPSDK.createImage(outGeometry)
# 3d zoom
gtrans.zoom3dImg(inImg, xScaleFactor, yScaleFactor, zScaleFactor, PyIPSDK.eZoomInterpolationMethod.eZIM_NearestNeighbour, outImg)

Example of C++ code :

Example informations

Associated library

IPSDKIPLGeometricTransform

Header file

Code Example

// opening input image
ImagePtr pInImg = loadTiffImageFile(inputImgPath, eTiffDirectoryMode::eTDM_Volume);
if(inImageBufferType != pInImg->getBufferType())
pInImg = convertImg(pInImg, inImageBufferType);
ImagePtr pOutImg = zoom3dImg(pInImg, xScaleFactor, yScaleFactor, zScaleFactor, interpolationMethod);
See also
Zoom3dImgLvl1
Zoom3dImgLvl2
Zoom3dImgLvl3

Function Documentation

◆ zoom3dImg() [1/4]

IPSDKIPLGEOMETRICTRANSFORM_API image::ImagePtr ipsdk::imaproc::gtrans::zoom3dImg ( const image::ImageConstPtr pInImg,
ipReal64  xZoomFactor,
ipReal64  yZoomFactor,
ipReal64  zZoomFactor,
const ipsdk::imaproc::attr::eZoomInterpolationMethod interpolationMethod 
)

wrapper function for image 3d zoom algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ zoom3dImg() [2/4]

IPSDKIPLGEOMETRICTRANSFORM_API image::ImagePtr ipsdk::imaproc::gtrans::zoom3dImg ( const image::ImageConstPtr pInImg,
ipReal64  zoomFactor,
const ipsdk::imaproc::attr::eZoomInterpolationMethod interpolationMethod 
)

wrapper function for image 3d zoom algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ zoom3dImg() [3/4]

IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::zoom3dImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::eZoomInterpolationMethod interpolationMethod,
const image::ImagePtr pOutImg 
)

wrapper function for image 3d zoom algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ zoom3dImg() [4/4]

IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::zoom3dImg ( const image::ImageConstPtr pInImg,
ipReal64  xZoomFactor,
ipReal64  yZoomFactor,
ipReal64  zZoomFactor,
const ipsdk::imaproc::attr::eZoomInterpolationMethod interpolationMethod,
const image::ImagePtr pOutImg 
)

wrapper function for image 3d zoom algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure