IPSDK 4.2
IPSDK : Image Processing Software Development Kit
Pearson colocalization mapping 2d
image = pearsonColocalization2dImg (inImg1,inImg2)

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

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

Header file

#include <IPSDKIPL/IPSDKIPLFiltering/Processor/PearsonColocalization2dImg/PearsonColocalization2dImg.h>

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);