IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Algorithm allowing to set the the 3d ROI of an image with the content of another image. More...

IPSDKIPLUTILITY_API void ipsdk::imaproc::util::putROI3dImg (const image::ImagePtr &pInOutImg, const image::ImageConstPtr &pInRoiImg, ipUInt64 xOffset, ipUInt64 yOffset, ipUInt64 zOffset)
 wrapper function for image copy algorithm More...
 
IPSDKIPLUTILITY_API void ipsdk::imaproc::util::putROI3dImg (const image::ImageConstPtr &pInImg, const image::ImageConstPtr &pInRoiImg, ipUInt64 xOffset, ipUInt64 yOffset, ipUInt64 zOffset, const image::ImagePtr &pOutImg)
 wrapper function for image copy algorithm More...
 

Detailed Description

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 :

\[ OutImg[x, y, z] = \begin{cases} InROIImg[x, y, z] & \text { if } x-InInputImg2dOffset::XOffset \in [0 .. InROIImgXSize-1] \text { and } y-InInputImg2dOffset::YOffset \in [0 .. InROIImgYSize-1] \text { and } z-InInputImg2dOffset::ZOffset \in [0 .. InROIImgZSize-1] \\ InImg[x, y, z] & \text { otherwise} \end{cases} \]

,

with $InROIImgXSize$, $InROIImgYSize$ and $InROIImgZSize$the sizes of InROIImg image along x-axis, y-axis and z-axis, respectively.

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InROIImg3d [Input] 3d ROI image for operation X
ipsdk::imaproc::attr::InInputImg3dOffset [Input] input image 3d offset X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation duplicateInOut (_pOutImg, _pInImg3d)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSizeAndType (_pInImg3d,_pOutImg) && 
ipsdk::imaproc::matchBufferType (_pInImg3d,_pInROIImg3d) && 
ipsdk::imaproc::matchSize (eMatchImageSizeType::eMIST_CT,_pInImg3d,_pInROIImg3d) && 
ipsdk::imaproc::customImageProperty (_pInImg3d,
 ipsdk::imaproc::util::containsROI3d (_pInImg3d,_pInInputImg3dOffset,_pInROIImg3d))

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLUtility as util

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
inROIImg = PyIPSDK.loadTiffImageFile(inputROIImgPath, PyIPSDK.eTiffDirectoryMode.eTDM_Volume)
# intialization of output image
outGeometry = PyIPSDK.geometry3d(PyIPSDK.eImageBufferType.eIBT_UInt8, 50, 50, 50)
outImg = PyIPSDK.createImage(outGeometry)
# 2d ROI insertion
util.putROI3dImg(inImg, inROIImg, 21, 22, 23, outImg)

Example of C++ code :

Example informations

Associated library

IPSDKIPLUtility

Header file

Code Example

// opening input image
ImagePtr pInImg = loadTiffImageFile(inputImgPath, eTiffDirectoryMode::eTDM_Volume);
if(pInImg->getBufferType() != imageBufferType)
pInImg = convertImg(pInImg, 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());
// ROI insertion in image
putROI3dImg(pInImg, pInROIImg, inOffsetX, inOffsetY, inOffsetZ, pOutImg);
See also
PutROI3dImgLvl1
PutROI3dImgLvl2
PutROI3dImgLvl3

Function Documentation

◆ putROI3dImg() [1/2]

IPSDKIPLUTILITY_API void ipsdk::imaproc::util::putROI3dImg ( const image::ImagePtr pInOutImg,
const image::ImageConstPtr pInRoiImg,
ipUInt64  xOffset,
ipUInt64  yOffset,
ipUInt64  zOffset 
)

wrapper function for image copy algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ putROI3dImg() [2/2]

IPSDKIPLUTILITY_API void ipsdk::imaproc::util::putROI3dImg ( const image::ImageConstPtr pInImg,
const image::ImageConstPtr pInRoiImg,
ipUInt64  xOffset,
ipUInt64  yOffset,
ipUInt64  zOffset,
const image::ImagePtr pOutImg 
)

wrapper function for image copy algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure