IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

algorithm allowing to estimate probability density function of a 3d image More...

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::KDEDataSetPtr ipsdk::imaproc::glbmsr::kernelDensityEstimator3d (const image::ImageConstPtr &pInImg3d)
 wrapper function for algorithm allowing to estimate probability density function of a 3d image More...
 
IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::KDEDataSetPtr ipsdk::imaproc::glbmsr::kernelDensityEstimator3d (const image::ImageConstPtr &pInImg3d, const ipUInt32 inOptKDENbSamples, const ipsdk::imaproc::attr::KDEBandwidthPolicyConstPtr &pInOptKDEBandwidthPolicy)
 wrapper function for algorithm allowing to estimate probability density function of a 3d image More...
 
IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedKDEDataSetPtr ipsdk::imaproc::glbmsr::multiSlice_kernelDensityEstimator3d (const image::ImageConstPtr &pInImg3d)
 wrapper function for algorithm allowing to estimate probability density function of a 3d image More...
 
IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedKDEDataSetPtr ipsdk::imaproc::glbmsr::multiSlice_kernelDensityEstimator3d (const image::ImageConstPtr &pInImg3d, const ipUInt32 inOptKDENbSamples, const ipsdk::imaproc::attr::KDEBandwidthPolicyConstPtr &pInOptKDEBandwidthPolicy)
 wrapper function for algorithm allowing to estimate probability density function of a 3d image More...
 

Detailed Description

algorithm allowing to estimate probability density function of a 3d image

This algorithm allows to estimate the probability density function associated to the grey level population of a 3d image. This algorithm is also known as Parzen Rosenblatt window method.

Given an input 3d image InImg3d, the algorithm samples InOptKDENbSamples image values and build an ouput 'by plan' kernel density estimator object OutPIKDEDataSet.

The kernel density estimator bandwidth parameter value is computed with respect to the InOptKDEBandwidthPolicy parameter value.

Given a collection of image samples ${x_i}, i\in [0, N[$ and $h$ a bandwith for density estimation, image density $\hat{f}_h(x)$ is estimated for a given grey level $x$ as :

\[ \hat{f}_h(x)=\frac{1}{N\times h}\sum_{i=0}^{N}{K\left (\frac{x-x_i}{h}\right)} \]

where kernel function $K()$ is the zero mean and unit standard deviation gaussian function given by :

\[ K(x)=\frac{1}{\sqrt{2\pi}}e^{-\frac{1}{2}x^2} \]

See Kernel Density Estimator 2d for an example of kernel density estimation computation in 2d case.

See also
https://en.wikipedia.org/wiki/Kernel_density_estimation

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d [Input] 3d image for operation X
ipsdk::imaproc::attr::InOptKDENbSamples [Input Optional] number of sample for kernel density estimation X
ipsdk::imaproc::attr::InOptKDEBandwidthPolicy [Input Optional] policy used to compute smoothing bandwidth parameter during a kernel density estimation X
ipsdk::imaproc::attr::OutPIKDEDataSet [Output] plan indexed collection of kernel density estimator result data set ipsdk::imaproc::fromImageButVolume (_pOutPIKDEDataSet, _pInImg3d)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchImagePlansButVolume (_pOutPIKDEDataSet,_pInImg3d)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGlobalMeasure as glbmsr

Code Example

# opening of input image
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
nbTotPixels = inImg.getGeometry().getNbPixels()
# computation of kernel density estimation
kdeDataSet = glbmsr.kernelDensityEstimator3d(inImg)
# extraction of associated histogram
binMin = 0
binMax = 65535
binWidth = 512
estimHisto = PyIPSDK.generateHistogram(kdeDataSet,
binMin, binMax, binWidth,
nbTotPixels)

Example of C++ code :

Example informations

Associated library

IPSDKIPLGlobalMeasure

Header file

Code Example

// Load the input image
ImagePtr pInImg = loadTiffImageFile(inImgFilePath);
const ipUInt64 nbTotPixels = pInImg->getGeometry().getNbPixels();
// computation of kernel density estimation
KDEDataSetPtr pKDEDataSet = kernelDensityEstimator3d(pInImg);
// extraction of associated histogram
const ipReal64 binMin = 0;
const ipReal64 binMax = 65535;
const ipReal64 binWidth = 512;
HistogramDataPtr pEstimHisto = generateHistogram(*pKDEDataSet,
binMin, binMax, binWidth,
nbTotPixels);
See also
KernelDensityEstimator3dLvl1
KernelDensityEstimator3dLvl2

Function Documentation

◆ kernelDensityEstimator3d() [1/2]

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::KDEDataSetPtr ipsdk::imaproc::glbmsr::kernelDensityEstimator3d ( const image::ImageConstPtr pInImg3d)

wrapper function for algorithm allowing to estimate probability density function of a 3d image

Note
This wrapper must be used with mono slice input images
Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ multiSlice_kernelDensityEstimator3d() [1/2]

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedKDEDataSetPtr ipsdk::imaproc::glbmsr::multiSlice_kernelDensityEstimator3d ( const image::ImageConstPtr pInImg3d)

wrapper function for algorithm allowing to estimate probability density function of a 3d image

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

◆ kernelDensityEstimator3d() [2/2]

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::KDEDataSetPtr ipsdk::imaproc::glbmsr::kernelDensityEstimator3d ( const image::ImageConstPtr pInImg3d,
const ipUInt32  inOptKDENbSamples,
const ipsdk::imaproc::attr::KDEBandwidthPolicyConstPtr pInOptKDEBandwidthPolicy 
)

wrapper function for algorithm allowing to estimate probability density function of a 3d image

Note
This wrapper must be used with mono slice input images
Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ multiSlice_kernelDensityEstimator3d() [2/2]

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedKDEDataSetPtr ipsdk::imaproc::glbmsr::multiSlice_kernelDensityEstimator3d ( const image::ImageConstPtr pInImg3d,
const ipUInt32  inOptKDENbSamples,
const ipsdk::imaproc::attr::KDEBandwidthPolicyConstPtr pInOptKDEBandwidthPolicy 
)

wrapper function for algorithm allowing to estimate probability density function of a 3d image

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