IPSDK 4.1.0.2
IPSDK : Image Processing Software Development Kit
Local histogram module 3d
imagelocalHistogramModule3dImg (inImg3d,inHalfKnlSizeX,inHalfKnlSizeY,inHalfKnlSizeZ)
imagelocalHistogramModule3dImg (inImg3d,inHalfKnlSizeX,inHalfKnlSizeY,inHalfKnlSizeZ,inOptNbClasses)

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.

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

Header file

#include <IPSDKIPL/IPSDKIPLStats/Processor/LocalHistogramModule3dImg/LocalHistogramModule3dImg.h>

Code Example

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