IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
ResampleCustomZStack3dImg algorithm

Resamples along z-axis a 3d image with unregularly spaced z-plans. More...

IPSDKIPLGEOMETRICTRANSFORM_API image::ImagePtr ipsdk::imaproc::gtrans::resampleCustomZStack3dImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::ZStepsConstPtr &inZSteps, const ipUInt64 outputImgZSize, const ipsdk::imaproc::attr::eInterpolationPolicy &interpolationPolicy)
 wrapper function for Resamples along z-axis a 3d image with unregularly spaced z-plans More...
 
IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::resampleCustomZStack3dImg (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::ZStepsConstPtr &inZSteps, const ipsdk::imaproc::attr::eInterpolationPolicy &interpolationPolicy, const image::ImagePtr &pOutImg)
 wrapper function for Resamples along z-axis a 3d image with unregularly spaced z-plans More...
 

Detailed Description

Resamples along z-axis a 3d image with unregularly spaced z-plans.

This algorithm allows to resample along z-axis a 3d image with unregularly spaced z-plans, so that the resulting 3d image z-plans are regularly spaced.

The parameters of this algorithm are:

If the user allocates the output image, this last one must satisfy the following criterions:

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InZSteps [Input] collection of distances between successive z-plans of the image X
ipsdk::imaproc::attr::InInterpolationPolicy [Input] interpolation policy used to extract local data from image X
ipsdk::imaproc::attr::InOutputImg3dZSize [Input] z-size of 3d output image X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation customOutput (_pOutImg, outputZoom3dZ(_pInImg3d,_pInOutputImg3dZSize))

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::noInSitu (_pInImg3d,_pOutImg) && 
ipsdk::imaproc::matchSize (eMatchImageSizeType::eMIST_CT,_pInImg3d,_pOutImg) && 
ipsdk::imaproc::matchSize (eMatchImageSizeType::eMIST_2d,_pInImg3d,_pOutImg) && 
ipsdk::imaproc::customImageProperty (_pInImg3d,
 ipsdk::imaproc::gtrans::matchZStepsCollSize (_pInImg3d,_pInZSteps))

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGeometricTransform as gtrans

Code Example

# define input 3d image from file path
inputImgPath = os.path.join(utImagesPath, "heterogeneousSubSample.tif")
# load input 3d image from file
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# specify distances between z-plans in input 3d image
zSteps = PyIPSDK.createZSteps([ 1.1, 0.1, 0.1, 0.7, 1.3, 1.2, 0.5, 0.8, 0.7, 0.7, 0.6, 0.7, 1.4 ])
# apply cubic resampling on input image; output image will have 100 z-plans,
# that will be regularly spaced
outImg = gtrans.resampleCustomZStack3dImg(inImg, zSteps, 100, PyIPSDK.eInterpolationPolicy.eIP_Cubic)

Example of C++ code :

Example informations

Associated library

IPSDKIPLGeometricTransform

Header file

Code Example

// load input 3d image from file
ImagePtr pInImg = loadTiffImageFile(inImgFilePath);
// specify distances between z-plans in input 3d image
boost::shared_ptr<attr::ZSteps> pZSteps = attr::ZSteps::createNode();
pZSteps->push_back<attr::ZSteps::StepsColl>(0.990f); // distance between image #0 and image #1 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(1.015f); // distance between image #1 and image #2 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(0.988f); // distance between image #2 and image #3 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(0.994f); // distance between image #3 and image #4 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(1.007f); // distance between image #4 and image #5 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(0.995f); // distance between image #5 and image #6 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(0.997f); // distance between image #6 and image #7 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(0.996f); // distance between image #7 and image #8 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(1.007f); // distance between image #8 and image #9 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(1.003f); // distance between image #9 and image #10 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(0.998f); // distance between image #10 and image #11 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(0.994f); // distance between image #11 and image #12 along z-axis
pZSteps->push_back<attr::ZSteps::StepsColl>(0.999f); // distance between image #12 and image #13 along z-axis
// apply linear resampling on input image; output image will have 8 z-plans, that will be regularly spaced with a step that will equal to 1.000
See also
ResampleCustomZStack3dImgLvl1
ResampleCustomZStack3dImgLvl2
ResampleCustomZStack3dImgLvl3

Function Documentation

◆ resampleCustomZStack3dImg() [1/2]

IPSDKIPLGEOMETRICTRANSFORM_API image::ImagePtr ipsdk::imaproc::gtrans::resampleCustomZStack3dImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::ZStepsConstPtr inZSteps,
const ipUInt64  outputImgZSize,
const ipsdk::imaproc::attr::eInterpolationPolicy interpolationPolicy 
)

wrapper function for Resamples along z-axis a 3d image with unregularly spaced z-plans

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ resampleCustomZStack3dImg() [2/2]

IPSDKIPLGEOMETRICTRANSFORM_API void ipsdk::imaproc::gtrans::resampleCustomZStack3dImg ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::ZStepsConstPtr inZSteps,
const ipsdk::imaproc::attr::eInterpolationPolicy interpolationPolicy,
const image::ImagePtr pOutImg 
)

wrapper function for Resamples along z-axis a 3d image with unregularly spaced z-plans

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure