Resamples along z-axis a 3d image with regularly spaced z-plans.
This algorithm allows to resample along z-axis a 3d image with regularly spaced z-plans.
The parameters of this algorithm are:
: integral value, strictly positive, specifying the size of the resulting image along its z-axis. This parameter is used only if the geometry of the output image is initialized by the algorithm, not by the user. If this parameter is initialized, the
must be left unspecified,
: floating value, strictly positive, specifying the scale factor to apply for the resampling along the z-axis. If this parameter is initialized, the
must be left unspecified,
: enumerate permitting to specify the interpolation method used to resample the image. The following interpolation methods are available:
- eInterpolationPolicy::eIP_NearestNeighbour: the voxel value of the output image at position (xOut, yOut, zOut) equals to the value of the voxel nearest to the associated position in the input image along the z-axis. This is the certainly one of the fastest methods, but it generates a coarse image, with aliasing,
- eInterpolationPolicy::eIP_Linear: for each voxel of the output image, the voxel value is computed by doing a linear interpolation on the 2 nearest neighbours along the z-axis. It gives satisfying results, and it is a good compromise between speed and quality,
- eInterpolationPolicy::eIP_Cubic: for each voxel of the output image, the voxel value is computed by doing a cubic interpolation on the 4 nearest neighbours along the z-axis. This method is slower than the linear interpolation, but it usually gives better results, generating sharper edges than linear interpolation.
If the user allocates the output image, this last one must satisfy the following criterions:
- its sizes along x-axis and y-axis must equal to the sizes of the input image along x-axis and y-axis,
- its temporal size must equal to the temporal size of the input image,
- the number of its color channel must equal to the number of color channels of the input image,
- if the
parameter is specified, the size along z-axis of the output image must equal to the integer part of
.
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLGeometricTransform as gtrans
Code Example
inputImgPath = os.path.join(utImagesCommonPath, "Rope3d.tif")
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
zScaleFactor = 1.234
outImg = gtrans.resampleRegularZStack3dImg(inImg, zScaleFactor, PyIPSDK.eInterpolationPolicy.eIP_Linear)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLGeometricTransform/Processor/ResampleRegularZStack3dImg/ResampleRegularZStack3dImg.h>
Code Example
const ipReal32 zScaleFactor = 1.234f;