IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Global Entropy 2dSee full documentation
scalarglobalEntropyMsr2d (inImg)
scalarglobalEntropyMsr2d (inImg,histoPrms)

Detailed Description

Compute 2d image global entropy.

The global entropy of an image is a measure calculated using the image histogram, which gives information about the image disorder. This measure is calculated with the following formula :

\[ S=-\sum _{{i} \in \Omega}P_{i}\log {P_{i}} \]

Where $ \Omega $ is the image domain, and $ P_{i} $ is the probability of appearance of a pixel with the value i.

Two wrappers can be called : the globalEntropyMsr2d wrapper is only used to compute the global entropy measure on a grey level 2d image, whereas the multiSlice_globalEntropyMsr2d wrapper must be used for more complex data (volume, sequence and/or color). In the second case, a measure is calculated for each 2d plan forming the input images.

See also
https://en.wikipedia.org/wiki/Entropy_(information_theory)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGlobalMeasure as glbmsr

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
histogramMsrParams = PyIPSDK.createHistoMsrParamsWithBinWidth(0, 255, 1)
#single slice entropy measurement
result = glbmsr.globalEntropyMsr2d(inImg,histogramMsrParams)
print (result)
#multislice entropy measurement
multislice_result = glbmsr.multiSlice_globalEntropyMsr2d(inImg)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLGlobalMeasure/Processor/GlobalEntropyMsr2d/GlobalEntropyMsr2d.h>

Code Example

// --------------------------------- Compute the entropy of a mono-slice grey level image ---------------------------------- //
ImageGeometryPtr pInputImageGeometry2d = geometry2d(inType, sizeX, sizeY);
ImagePtr pInImg = loadRawImageFile(inPath, *pInputImageGeometry2d);
const ipReal64 entropy = globalEntropyMsr2d(pInImg);
// --------------------------------- Compute the entropy of a multi-slice grey level image ---------------------------------- //
ImageGeometryPtr pInputImageGeometry3d = geometry3d(inType, sizeX, sizeY, sizeZ);
ImagePtr pInImg_multiSlice = loadRawImageFile(inPath, *pInputImageGeometry3d);
PlanIndexedGlobalEntropyResultPtr pEntropyMultiSlice = ipsdk::imaproc::glbmsr::multiSlice_globalEntropyMsr2d(pInImg_multiSlice);