IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

computes the Pearson correlation coefficient in the 3d image More...

IPSDKIPLGLOBALMEASURE_API ipReal64 ipsdk::imaproc::glbmsr::pearsonCorrelationCoefficient3d (const image::ImageConstPtr &pInImg3d1, const image::ImageConstPtr &pInImg3d2)
 wrapper function for computes the Pearson correlation coefficient in the 3d image More...
 
IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedPearsonCCResultPtr ipsdk::imaproc::glbmsr::multiSlice_pearsonCorrelationCoefficient3d (const image::ImageConstPtr &pInImg3d1, const image::ImageConstPtr &pInImg3d2)
 wrapper function for computes the Pearson correlation coefficient in the image More...
 

Detailed Description

computes the Pearson correlation coefficient in the 3d image

The Pearson correlation coefficient, also known as Pearson colocalization, is a linear correlation measure between the two input images InImg3d1 and InImg3d2. This coefficient is calculated with the following formula :

\[ PCC = \sum_{\textbf{x} \in \Omega}{\frac{ \left( InImg3d1[\textbf{x}] - \mu_1\right) \left( InImg3d2[\textbf{x}] - \mu_2\right)}{\sigma_1 \sigma_2}} \]

Where $\Omega$ is the image domain, $ \mu_i, i \in [1, 2]$ is the mean intensity of $InImg_i$ and $\sigma_i$ is its standard deviation.

Two wrappers can be called : the pearsonCorrelationCoefficient3d wrapper is only used to compute the Pearson coefficient on a grey level 3d image, whereas the multiSlice_pearsonCorrelationCoefficient3d wrapper must be used for more complex data (sequence and/or color). In the second case, a coefficient is calculated for each 3d volume forming the input images.

This algorithm is the 3d version of Pearson Correlation Coefficient 2d.

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d1 [Input] First 3d image for operation X
ipsdk::imaproc::attr::InImg3d2 [Input] Second 3d image for operation X
ipsdk::imaproc::attr::OutPIPearsonCCResult [Output] Plan indexed collection of results for Pearson correlation coefficient ipsdk::imaproc::fromImageButVolume (_pOutPIPearsonCCResult, _pInImg3d1)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg3d1,_pInImg3d2) && 
ipsdk::imaproc::matchImagePlans (_pOutPIPearsonCCResult,_pInImg3d1,eImagePlansMatchPolicy::eIPMP_CT)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGlobalMeasure as glbmsr

Code Example

# Sample a single slice result
result = glbmsr.pearsonCorrelationCoefficient3d(inImg1, inImg2)
# Sample a multislice result
multislice_result = glbmsr.multiSlice_pearsonCorrelationCoefficient3d(inImg1, inImg2)

Example of C++ code :

Example informations

Associated library

IPSDKIPLGlobalMeasure

Header file

Code Example

// --------------------------------- Compute the Pearson colocalization a mono-slice grey level image ---------------------------------- //
const ipReal64 pearsonCorrCoeff = pearsonCorrelationCoefficient3d(pInImg1, pInImg2);
// ----------------------------------------------- Calculation on a multi-slice RGB image ---------------------------------------------- //
PlanIndexedPearsonCCResultPtr pPearsonCorrCoeff_MultiSlice = multiSlice_pearsonCorrelationCoefficient3d(pImg1_multiSlice, pImg2_multiSlice);
See also
PearsonCorrelationCoefficient3dLvl1
PearsonCorrelationCoefficient3dLvl2
PearsonCorrelationCoefficient3dLvl3

Function Documentation

◆ pearsonCorrelationCoefficient3d()

IPSDKIPLGLOBALMEASURE_API ipReal64 ipsdk::imaproc::glbmsr::pearsonCorrelationCoefficient3d ( const image::ImageConstPtr pInImg3d1,
const image::ImageConstPtr pInImg3d2 
)

wrapper function for computes the Pearson correlation coefficient in the 3d image

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ multiSlice_pearsonCorrelationCoefficient3d()

IPSDKIPLGLOBALMEASURE_API ipsdk::imaproc::attr::PlanIndexedPearsonCCResultPtr ipsdk::imaproc::glbmsr::multiSlice_pearsonCorrelationCoefficient3d ( const image::ImageConstPtr pInImg3d1,
const image::ImageConstPtr pInImg3d2 
)

wrapper function for computes the Pearson correlation coefficient in the image

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