IPSDK 0.2
IPSDK : Image Processing Software Development Kit
ResampleCustomZStack3dImg algorithmSee full documentation
imageresampleCustomZStack3dImg (inImg,inZSteps,outputImgZSize,interpolationPolicy)

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:

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

Header file

#include <IPSDKIPL/IPSDKIPLGeometricTransform/Processor/ResampleCustomZStack3dImg/ResampleCustomZStack3dImg.h>

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
ImagePtr pOutImg = resampleCustomZStack3dImg(pInImg, pZSteps, 8, attr::eInterpolationPolicy::eIP_Linear);