IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

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

IPSDKIPLUTILITY_API image::ImagePtr ipsdk::imaproc::util::getROI3dImg (const image::ImageConstPtr &pInImg, ipUInt64 xOffset, ipUInt64 yOffset, ipUInt64 zOffset, ipUInt64 xSz, ipUInt64 ySz, ipUInt64 zSz)
 wrapper function for 3d ROI extraction algorithm More...
 
IPSDKIPLUTILITY_API void ipsdk::imaproc::util::getROI3dImg (const image::ImageConstPtr &pInImg, ipUInt64 xOffset, ipUInt64 yOffset, ipUInt64 zOffset, ipUInt64 xSz, ipUInt64 ySz, ipUInt64 zSz, const image::ImagePtr &pOutImg)
 wrapper function for 3d ROI extraction algorithm More...
 

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:

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InInputImg3dOffset [Input] input image 3d offset X
ipsdk::imaproc::attr::InOutputImg3dSize [Input] output image 3d size X
ipsdk::imaproc::attr::OutImg [Output] image for processing operation customOutput (_pOutImg, outputROI3d(_pInImg3d,_pInOutputImg3dSize))

Global Rule description

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

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

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);
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);
See also
GetROI3dImgLvl1
GetROI3dImgLvl2
GetROI3dImgLvl3

Function Documentation

◆ getROI3dImg() [1/2]

IPSDKIPLUTILITY_API image::ImagePtr ipsdk::imaproc::util::getROI3dImg ( const image::ImageConstPtr pInImg,
ipUInt64  xOffset,
ipUInt64  yOffset,
ipUInt64  zOffset,
ipUInt64  xSz,
ipUInt64  ySz,
ipUInt64  zSz 
)

wrapper function for 3d ROI extraction algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ getROI3dImg() [2/2]

IPSDKIPLUTILITY_API void ipsdk::imaproc::util::getROI3dImg ( const image::ImageConstPtr pInImg,
ipUInt64  xOffset,
ipUInt64  yOffset,
ipUInt64  zOffset,
ipUInt64  xSz,
ipUInt64  ySz,
ipUInt64  zSz,
const image::ImagePtr pOutImg 
)

wrapper function for 3d ROI extraction algorithm

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure