IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

local 3d image entropy computation More...

IPSDKIPLSTATS_API image::ImagePtr ipsdk::imaproc::stats::localEntropy3dImg (const image::ImageConstPtr &pInImg3d, const ipUInt32 inHalfKnlSizeX, const ipUInt32 inHalfKnlSizeY, const ipUInt32 inHalfKnlSizeZ)
 wrapper function for local entropy on a 3d image More...
 
IPSDKIPLSTATS_API image::ImagePtr ipsdk::imaproc::stats::localEntropy3dImg (const image::ImageConstPtr &pInImg3d, const ipUInt32 inHalfKnlSizeX, const ipUInt32 inHalfKnlSizeY, const ipUInt32 inHalfKnlSizeZ, const ipUInt32 inOptNbClasses)
 wrapper function for local entropy on a 3d image More...
 
IPSDKIPLSTATS_API void ipsdk::imaproc::stats::localEntropy3dImg (const image::ImageConstPtr &pInImg3d, const ipUInt32 inHalfKnlSizeX, const ipUInt32 inHalfKnlSizeY, const ipUInt32 inHalfKnlSizeZ, const ipUInt32 inOptNbClasses, const image::ImagePtr &pOutImg)
 wrapper function for local entropy on a 3d image More...
 

Detailed Description

local 3d image entropy computation

This algorithm computes for each pixel of output image associated local entropy on a box neighbourhood of input image

Given an input image $InImg$, box kernel half sizes $N_x = InHalfKnlSizeX$, $N_y = InHakfKnlSizeY$ and $N_z = InHalfKnlSizeZ$ and a number of classes $n$, output image values are given by :

\[ OutImg[x, y, z] = -\sum_{i=0}^{n}{p(i).log(p(i))} \]

where:

The number of classes is an optional parameter of the algorithm. Its default value equals to 16. If the number of classes specified by the user exceeds the maximum allowed number of classes given the input image data type and dynamic range, it is automatically adjusted. For instance:

Borders of input image are processed as followed: padding pixels are a mirror reflection of the border pixels in the input image (see Border policy for more details).

Here is an example of an output image computed from the LocalEntropy3dImg algorithm on a 8-bits grey level, with a kernel of size 3 pixels x 4 pixels x 5 pixels and 8 classes:

localEntropy3dImg.png

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InHalfKnlSizeX [Input] half kernel size along X axis for operation X
ipsdk::imaproc::attr::InHalfKnlSizeY [Input] half kernel size along Y axis for operation X
ipsdk::imaproc::attr::InHalfKnlSizeZ [Input] half kernel size along Z axis for operation X
ipsdk::imaproc::attr::InOptNbClasses [Input Optional] number of classes X
ipsdk::imaproc::attr::OutRealImg [Output] image for processing operation (data contained in image buffer are reals) ipsdk::imaproc::duplicateInOut (_pOutRealImg, _pInImg3d, image::eImageBufferType::eIBT_Real32)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg3d,_pOutRealImg)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLStats as stats

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# local entropy 3d image computation
outImg = stats.localEntropy3dImg(inImg, 3, 3, 3)

Example of C++ code :

Example informations

Associated library

IPSDKIPLStats

Header file

Code Example

// compute local entropy on input image
ImagePtr pOutImg = localEntropy3dImg(pInImg, inHalfKnlSizeX, inHalfKnlSizeY, inHalfKnlSizeZ, nbClasses);
See also
LocalEntropy3dImgLvl1
LocalEntropy3dImgLvl2
LocalEntropy3dImgLvl3

Function Documentation

◆ localEntropy3dImg() [1/3]

IPSDKIPLSTATS_API image::ImagePtr ipsdk::imaproc::stats::localEntropy3dImg ( const image::ImageConstPtr pInImg3d,
const ipUInt32  inHalfKnlSizeX,
const ipUInt32  inHalfKnlSizeY,
const ipUInt32  inHalfKnlSizeZ 
)

wrapper function for local entropy on a 3d image

Exceptions
ipsdk::imaproc::util::IPSDKIPLUtilityExceptionon failure

◆ localEntropy3dImg() [2/3]

IPSDKIPLSTATS_API image::ImagePtr ipsdk::imaproc::stats::localEntropy3dImg ( const image::ImageConstPtr pInImg3d,
const ipUInt32  inHalfKnlSizeX,
const ipUInt32  inHalfKnlSizeY,
const ipUInt32  inHalfKnlSizeZ,
const ipUInt32  inOptNbClasses 
)

wrapper function for local entropy on a 3d image

Exceptions
ipsdk::imaproc::util::IPSDKIPLUtilityExceptionon failure

◆ localEntropy3dImg() [3/3]

IPSDKIPLSTATS_API void ipsdk::imaproc::stats::localEntropy3dImg ( const image::ImageConstPtr pInImg3d,
const ipUInt32  inHalfKnlSizeX,
const ipUInt32  inHalfKnlSizeY,
const ipUInt32  inHalfKnlSizeZ,
const ipUInt32  inOptNbClasses,
const image::ImagePtr pOutImg 
)

wrapper function for local entropy on a 3d image

Exceptions
ipsdk::imaproc::util::IPSDKIPLUtilityExceptionon failure