IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Lowitz local histogram module on a 3d image. More...

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

Detailed Description

Lowitz local histogram module on a 3d image.

This algorithm computes for each pixel of the 3d input image its associated local histogram module on a rectangular neighbourhood.

This measure is the Mahalanobis distance between the actual local histogram $H$ and the theoretical histogram $H_t$ for which each bin has the same values. Based on the Bernoulli distribution, the measure can be expressed as :

\[ d(H, H_t) = \sum_{i = 0}^{C-1}{\frac{\vert H_i - \frac{N}{C} \vert}{\sqrt{H_i \left( 1 - p_i \right) + \frac{N}{C} \left( 1 - \frac{1}{C} \right)}}} \]

Where $H_i$ is the $ i^{th} $ bin of the histogram $H$, $C$ is the number of classes of $H$ and $N = N_x \times N_y \times N_z = \sum_{i = 0}^{C-1}{H_i}$ is the number of pixels in the neighbourhood.

The histogram $H$ is computed on the rectangular kernel, with following parameters:

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:

The borders of the input image are handled by padding pixels with a mirror reflection of the border pixels in input image (see Border policy for more details).

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

localHistogramModule3dImg.png

See Local histogram module 2d for more details.

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 2d image computation
outImg = stats.localHistogramModule3dImg(inImg, 3, 4, 5, 8)

Example of C++ code :

Example informations

Associated library

IPSDKIPLStats

Header file

Code Example

// compute local energy on input image
ImagePtr pOutImg = localHistogramModule3dImg(pInImg, inHalfKnlSizeX, inHalfKnlSizeY, inHalfKnlSizeZ, nbClasses);
See also
LocalHistogramModule3dImgLvl1
LocalHistogramModule3dImgLvl2
LocalHistogramModule3dImgLvl3

Function Documentation

◆ localHistogramModule3dImg() [1/3]

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

wrapper function for Lowitz local histogram module on a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ localHistogramModule3dImg() [2/3]

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

wrapper function for Lowitz local histogram module on a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ localHistogramModule3dImg() [3/3]

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

wrapper function for Lowitz local histogram module on a 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure