IPSDK 0.2
IPSDK : Image Processing Software Development Kit
imagegetROI3dImg (inImg,xOffset,yOffset,zOffset,xSz,ySz,zSz)

Detailed Description

Algorithm allowing to copy a 3d ROI of an image.

This algorithm allows to copy the region of interest, delimited by a 3d box, of an image.
The box is defined by the 2 attributes InInputImg3dOffset and InOutputImg3dSize.
Output image type is the same as input.
Size of output image is given by the InOutputImg3dSize attribute.

On output image, values are given by :

\[ OutImg[x, y, z] = InROIImg[x-InInputImg3dOffset::XOffset, y-InInputImg3dOffset::YOffset, z-InInputImg3dOffset::ZOffset] \]

,

with:

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLUtility as util

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# 3d ROI extraction
outImg = util.getROI3dImg(inImg, 10, 11, 12, 19, 20, 21)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLUtility/Processor/GetROI3dImg/GetROI3dImg.h>

Code Example

// opening input image
ImagePtr pInImg = loadTiffImageFile(inputImgPath, eTiffDirectoryMode::eTDM_Volume);
if(pInImg->getBufferType() != imageBufferType)
pInImg = convertImg(pInImg, imageBufferType);
ImageGeometryPtr pOutImageGeometry = geometry3d(imageBufferType, outSizeX, outSizeY, outSizeZ);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutImageGeometry);
// ROI extraction of image
getROI3dImg(pInImg, inOffsetX, inOffsetY, inOffsetZ, outSizeX, outSizeY, outSizeZ, pOutImg);