IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

Compute 2d image global entropy. More...

IPSDKIPLGLOBALMEASURE_API ipReal64 ipsdk::imaproc::glbmsr::globalEntropyMsr2d (const image::ImageConstPtr &pInImg)
 wrapper function for Compute 2d image global entropy More...
 
IPSDKIPLGLOBALMEASURE_API ipReal64 ipsdk::imaproc::glbmsr::globalEntropyMsr2d (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::HistoMsrParamsConstPtr &pHistoPrms)
 wrapper function for Compute 2d image global entropy More...
 
IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedGlobalEntropyResultPtr ipsdk::imaproc::glbmsr::multiSlice_globalEntropyMsr2d (const image::ImageConstPtr &pInImg)
 wrapper function for computes the global entropy measure in the image More...
 
IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedGlobalEntropyResultPtr ipsdk::imaproc::glbmsr::multiSlice_globalEntropyMsr2d (const image::ImageConstPtr &pInImg, const ipsdk::imaproc::attr::PlanIndexedHistoMsrParamsConstPtr &pPIHistoPrms)
 wrapper function for computes the global entropy measure in the image More...
 

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)

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InOptPIHistoMsrParams [Input] Plan indexed collection of histogram measure parameters X
ipsdk::imaproc::attr::OutPIGlobalEntropyResult [Output] Plan indexed global entropy measure ipsdk::imaproc::fromImage (_pOutPIGlobalEntropyResult, _pInImg)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchImagePlans (_pOutPIGlobalEntropyResult,_pInImg,eImagePlansMatchPolicy::eIPMP_ZCT) && 
ipsdk::processor::ifIsSet (_pInOptPIHistoMsrParams,
 ipsdk::imaproc::matchImagePlans (_pInOptPIHistoMsrParams,_pInImg,eImagePlansMatchPolicy::eIPMP_ZCT))

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

Associated library

IPSDKIPLGlobalMeasure

Header file

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);
See also
GlobalEntropyMsr2dLvl1
GlobalEntropyMsr2dLvl2

Function Documentation

◆ globalEntropyMsr2d() [1/2]

IPSDKIPLGLOBALMEASURE_API ipReal64 ipsdk::imaproc::glbmsr::globalEntropyMsr2d ( const image::ImageConstPtr pInImg)

wrapper function for Compute 2d image global entropy

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ multiSlice_globalEntropyMsr2d() [1/2]

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedGlobalEntropyResultPtr ipsdk::imaproc::glbmsr::multiSlice_globalEntropyMsr2d ( const image::ImageConstPtr pInImg)

wrapper function for computes the global entropy measure in the image

Note
This wrapper can be used with multi slice input images to retrieve by slice results
Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ globalEntropyMsr2d() [2/2]

IPSDKIPLGLOBALMEASURE_API ipReal64 ipsdk::imaproc::glbmsr::globalEntropyMsr2d ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::HistoMsrParamsConstPtr pHistoPrms 
)

wrapper function for Compute 2d image global entropy

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ multiSlice_globalEntropyMsr2d() [2/2]

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedGlobalEntropyResultPtr ipsdk::imaproc::glbmsr::multiSlice_globalEntropyMsr2d ( const image::ImageConstPtr pInImg,
const ipsdk::imaproc::attr::PlanIndexedHistoMsrParamsConstPtr pPIHistoPrms 
)

wrapper function for computes the global entropy measure in the image

Note
This wrapper can be used with multi slice input images to retrieve by slice results
Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure