IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

algorithm allowing to apply a motion transformation warping operation on a 3d image More...

IPSDKIPLGEOMETRICTRANSFORM_API image::ImagePtr ipsdk::imaproc::gtrans::warp3dImg (const image::ImageConstPtr &pInImg, const attr::WarpMotionTransform3dConstPtr &pInWarpMotionTransform3d)
 wrapper function for algorithm allowing to apply a motion transformation warping operation on a 3d image More...
 
IPSDKIPLGEOMETRICTRANSFORM_API image::ImagePtr ipsdk::imaproc::gtrans::warp3dImg (const image::ImageConstPtr &pInImg, const attr::WarpMotionTransform3dConstPtr &pInWarpMotionTransform3d, const attr::eInterpolationPolicy &inOptInterpolationPolicy)
 wrapper function for algorithm allowing to apply a motion transformation warping operation on a 3d image More...
 
IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::warp3dImg (const image::ImageConstPtr &pInImg, const attr::WarpMotionTransform3dConstPtr &pInWarpMotionTransform3d, const image::ImagePtr &pOutImg)
 wrapper function for algorithm allowing to apply a motion transformation warping operation on a 3d image More...
 
IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::warp3dImg (const image::ImageConstPtr &pInImg, const attr::WarpMotionTransform3dConstPtr &pInWarpMotionTransform3d, const attr::eInterpolationPolicy &inOptInterpolationPolicy, const image::ImagePtr &pOutImg)
 wrapper function for algorithm allowing to apply a motion transformation warping operation on a 3d image More...
 
IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::warp3dImg (const image::ImageConstPtr &pInImg, const attr::WarpMotionTransform3dConstPtr &pInWarpMotionTransform3d, const attr::eInterpolationPolicy &inOptInterpolationPolicy, const image::ImagePtr &pOutImg, const image::ImagePtr &pOutOptMaskImg)
 wrapper function for algorithm allowing to apply a motion transformation warping operation on a 3d image More...
 
IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::computeWarpedDefaultSize (const attr::WarpMotionTransform3d &motionTransform, const image::BaseImage &inputImg, ipUInt64 &outputSizeX, ipUInt64 &outputSizeY, ipUInt64 &outputSizeZ)
 function allowing to compute default output size for a warping transformation 3d
 
IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::computeWarpedDefaultSize (const attr::WarpMotionTransform3d &motionTransform, const ipUInt64 inputSizeX, const ipUInt64 inputSizeY, const ipUInt64 inputSizeZ, ipUInt64 &outputSizeX, ipUInt64 &outputSizeY, ipUInt64 &outputSizeZ)
 function allowing to compute default output size for a warping transformation 3d
 

Detailed Description

algorithm allowing to apply a motion transformation warping operation on a 3d image

This algorithm allows to apply a motion transformation defined by parameter $InWarpMotionTransform3d$ on an input image $InImg3d$. Available warping transformations are defined by enumerate ipsdk::math::transform::eGeometricTransform3dType.

Interpolation policy used during processing is defined by optional input parameter $InOptInterpolationPolicy$ (see ipsdk::imaproc::attr::eInterpolationPolicy).

On output, algorithm generates requested warped image $OutImg$ and optionally output mask image $OutOptMaskImg$. Size of output image is not ruled :

This process is illustrated in 2d case : see Warping 2d algorithm.

If output image is not provided by user, a default output image size is computed using computeWarpedDefaultSize function.

Here is an example of application of Warp3dImg algorithm on a 3d image in case of a centered rotation :

warp3dImg1.png

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::gtrans::InWarpMotionTransform3d [Input] motion transformation parameters associated to 3d warp operations X
ipsdk::imaproc::attr::InOptInterpolationPolicy [Input Optional] interpolation policy used to extract local data from image X
ipsdk::imaproc::attr::InOptTargetTile3dSideLength [Input Optional] target processing size for tile 3d (side length) X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation customOutput (_pOutImg, outputWarp(_pInImg3d,_pInWarpMotionTransform3d))
ipsdk::imaproc::attr::OutOptMaskImg [Output Optional] mask image for processing operation X

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchBufferType (_pInImg3d,_pOutImg) && 
ipsdk::processor::ifIsSet (_pOutOptMaskImg,
 ipsdk::imaproc::match3dMask (_pOutImg,_pOutOptMaskImg))

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGeometricTransform as gtrans

Code Example

# opening of input images
inImg3d = PyIPSDK.loadTiffImageFile(inputImgPath)
# case of a translation transformation
transform1 = PyIPSDK.createWarpMotionTransform3d(PyIPSDK.eGeometricTransform3dType.eGT3DT_Translation,
[10, 30, -7])
outImg1 = gtrans.warp3dImg(inImg3d, transform1)
# case of a rotation transformation with retrieval of output optional mask image
# In this case we compute a suitable output image size and allocate
# output image and output optional mask
transform2 = PyIPSDK.createCenteredRotation(math.pi/7, -math.pi/12, math.pi/6, inImg3d)
outputSizeX, outputSizeY, outputSizeZ = gtrans.computeWarpedDefaultSize(transform2, inImg3d)
outImg2 = PyIPSDK.createImage(PyIPSDK.eImageBufferType.eIBT_UInt16, outputSizeX, outputSizeY, outputSizeZ)
outOptMaskImg2 = PyIPSDK.createImage(PyIPSDK.eImageBufferType.eIBT_Binary, outputSizeX, outputSizeY, outputSizeZ)
gtrans.warp3dImg(inImg3d, transform2, PyIPSDK.eInterpolationPolicy.eIP_Cubic, outImg2, outOptMaskImg2)

Example of C++ code :

Example informations

Associated library

IPSDKIPLGeometricTransform

Header file

Code Example

// opening input image
ImagePtr pInImg3d = loadTiffImageFile(inputImgPath);
// case of a translation transformation
math::transform::Translation3d translation(10, 30, -7);
ImagePtr pOutImg1 = warp3dImg(pInImg3d, pTransform1);
// case of a rotation transformation with retrieval of output optional mask image
// In this case we compute a suitable output image size and allocate
// output image and output optional mask
WarpMotionTransform3dConstPtr pTransform2 = createCenteredRotation(M_PI / 7, -M_PI / 12, M_PI / 6, *pInImg3d);
ipUInt64 outputSizeX, outputSizeY, outputSizeZ;
computeWarpedDefaultSize(*pTransform2, *pInImg3d, outputSizeX, outputSizeY, outputSizeZ);
ImageGeometryPtr pOutGeometry2 = geometry3d(pInImg3d->getBufferType(), outputSizeX, outputSizeY, outputSizeZ);
MemoryImagePtr pOutImg2(boost::make_shared<MemoryImage>());
pOutImg2->init(*pOutGeometry2);
ImageGeometryPtr pOutMaskGeometry2 = geometry3d(eImageBufferType::eIBT_Binary, outputSizeX, outputSizeY, outputSizeZ);
MemoryImagePtr pOutOptMaskImg2(boost::make_shared<MemoryImage>());
pOutOptMaskImg2->init(*pOutMaskGeometry2);
warp3dImg(pInImg3d, pTransform2, eInterpolationPolicy::eIP_Cubic, pOutImg2, pOutOptMaskImg2);
See also
Warp3dImgLvl1
Warp3dImgLvl2
Warp3dImgLvl3

Function Documentation

◆ warp3dImg() [1/5]

IPSDKIPLGEOMETRICTRANSFORM_API image::ImagePtr ipsdk::imaproc::gtrans::warp3dImg ( const image::ImageConstPtr pInImg,
const attr::WarpMotionTransform3dConstPtr pInWarpMotionTransform3d 
)

wrapper function for algorithm allowing to apply a motion transformation warping operation on a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ warp3dImg() [2/5]

IPSDKIPLGEOMETRICTRANSFORM_API image::ImagePtr ipsdk::imaproc::gtrans::warp3dImg ( const image::ImageConstPtr pInImg,
const attr::WarpMotionTransform3dConstPtr pInWarpMotionTransform3d,
const attr::eInterpolationPolicy inOptInterpolationPolicy 
)

wrapper function for algorithm allowing to apply a motion transformation warping operation on a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ warp3dImg() [3/5]

IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::warp3dImg ( const image::ImageConstPtr pInImg,
const attr::WarpMotionTransform3dConstPtr pInWarpMotionTransform3d,
const image::ImagePtr pOutImg 
)

wrapper function for algorithm allowing to apply a motion transformation warping operation on a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ warp3dImg() [4/5]

IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::warp3dImg ( const image::ImageConstPtr pInImg,
const attr::WarpMotionTransform3dConstPtr pInWarpMotionTransform3d,
const attr::eInterpolationPolicy inOptInterpolationPolicy,
const image::ImagePtr pOutImg 
)

wrapper function for algorithm allowing to apply a motion transformation warping operation on a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ warp3dImg() [5/5]

IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::warp3dImg ( const image::ImageConstPtr pInImg,
const attr::WarpMotionTransform3dConstPtr pInWarpMotionTransform3d,
const attr::eInterpolationPolicy inOptInterpolationPolicy,
const image::ImagePtr pOutImg,
const image::ImagePtr pOutOptMaskImg 
)

wrapper function for algorithm allowing to apply a motion transformation warping operation on a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure