IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Pearson colocalization mapping 2d

builds the Pearson's colocalization map computing the Pearson correlation coefficient on each pixel More...

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::pearsonColocalization2dImg (const image::ImageConstPtr &pInImg1, const image::ImageConstPtr &pInImg2)
 wrapper function for builds the Pearson's colocalization map computing the Pearson correlation coefficient on each pixel More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::pearsonColocalization2dImg (const image::ImageConstPtr &pInImg1, const image::ImageConstPtr &pInImg2, const image::ImagePtr &pOutRealImg)
 wrapper function for builds the Pearson's colocalization map computing the Pearson correlation coefficient on each pixel More...
 

Detailed Description

builds the Pearson's colocalization map computing the Pearson correlation coefficient on each pixel

The Pearson colocalization, also known as Pearson correlation coefficient, is a linear correlation measure between the two input images InImg1 and InImg2. The result is a Real32 image where the intensity $OutRealImg[\textbf{x}]$ at the pixel at position $ \textbf{x} = \left[ x, y \right] $ is calculated with the following formula :

\[ OutRealImg[\textbf{x}] = \frac{ \left( InImg1[\textbf{x}] - \mu_1\right) \left( InImg2[\textbf{x}] - \mu_2\right)}{\sigma_1 \sigma_2} \]

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

Here is an example of Pearson colocalization mapping:

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg1 [Input] First image for processing operation X
ipsdk::imaproc::attr::InImg2 [Input] Second image for processing operation X
ipsdk::imaproc::attr::OutRealImg [Output] image for processing operation (data contained in image buffer are reals) ipsdk::imaproc::duplicateInOut (_pOutRealImg, _pInImg1, ipsdk::image::eImageBufferType::eIBT_Real32)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg1,_pInImg2) && 
ipsdk::imaproc::matchSize (_pInImg1,_pOutRealImg)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# Sample with a generated output image
outAutoImg = filter.pearsonColocalization2dImg(inImg1, inImg2)
# Sample with a provided output image
outImg = PyIPSDK.createImage(PyIPSDK.eImageBufferType.eIBT_Real32, inImg1.getSizeX(), inImg1.getSizeY())
filter.pearsonColocalization2dImg(inImg1, inImg2, outImg)

Example of C++ code :

Example informations

Associated library

IPSDKIPLFiltering

Header file

Code Example

// Sample with a generated output image
// ------------------------------------
// compute the pearson colocalization
ImagePtr pAutoOutImg = pearsonColocalization2dImg(pInImg1, pInImg2);
// Sample with a provided output image
// -----------------------------------
// create output image
ImageGeometryPtr pOutputImageGeometry = geometry2d(eImageBufferType::eIBT_Real32, sizeX, sizeY);
boost::shared_ptr<MemoryImage> pOutImg(boost::make_shared<MemoryImage>());
pOutImg->init(*pOutputImageGeometry);
// compute addition of input images
pearsonColocalization2dImg(pInImg1, pInImg2, pOutImg);
See also
PearsonColocalization2dImgLvl1
PearsonColocalization2dImgLvl2
PearsonColocalization2dImgLvl3

Function Documentation

◆ pearsonColocalization2dImg() [1/2]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::pearsonColocalization2dImg ( const image::ImageConstPtr pInImg1,
const image::ImageConstPtr pInImg2 
)

wrapper function for builds the Pearson's colocalization map computing the Pearson correlation coefficient on each pixel

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ pearsonColocalization2dImg() [2/2]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::pearsonColocalization2dImg ( const image::ImageConstPtr pInImg1,
const image::ImageConstPtr pInImg2,
const image::ImagePtr pOutRealImg 
)

wrapper function for builds the Pearson's colocalization map computing the Pearson correlation coefficient on each pixel

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure