void | putROI3dImg (inOutImg,inRoiImg,xOffset,yOffset,zOffset) |
void | putROI3dImg (inImg,inRoiImg,xOffset,yOffset,zOffset,outImg) |
Algorithm allowing to set the the 3d ROI of an image with the content of another image.
This algorithm to set the the 3d ROI of an image (InImgd3d) with the content of another image (InROIImg3d). The ROI is delimited by a box, defined by the attribute InInputImg3dOffset and by the size of the ROI image.
InImg3d and OutImg have the same type and size
InImg3d and InROIImg3d have the same type, and the size of InROIImg3d cannot exceed the size of InImg3d
On output image, values are given by :
,
with
,
and
the sizes of InROIImg image along x-axis, y-axis and z-axis, respectively.
Example of Python code :
Example imports
import PyIPSDK
import PyIPSDK.IPSDKIPLUtility as util
Code Example
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
inROIImg = PyIPSDK.loadTiffImageFile(inputROIImgPath, PyIPSDK.eTiffDirectoryMode.eTDM_Volume)
outGeometry = PyIPSDK.geometry3d(PyIPSDK.eImageBufferType.eIBT_UInt8, 50, 50, 50)
outImg = PyIPSDK.createImage(outGeometry)
util.putROI3dImg(inImg, inROIImg, 21, 22, 23, outImg)
Example of C++ code :
Example informations
Header file
#include <IPSDKIPL/IPSDKIPLUtility/Processor/PutROI3dImg/PutROI3dImg.h>
Code Example
if(pInImg->getBufferType() != imageBufferType)
ImagePtr pInROIImg =
loadTiffImageFile(inputROIImgPath, eTiffDirectoryMode::eTDM_Volume);
if(pInROIImg->getBufferType() != imageBufferType)
pInROIImg =
convertImg(pInROIImg, imageBufferType);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(pInImg->getGeometry());
putROI3dImg(pInImg, pInROIImg, inOffsetX, inOffsetY, inOffsetZ, pOutImg);