IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Pearson colocalization mapping 3dSee full documentation
imagepearsonColocalization3dImg (inImg3d1,inImg3d2)

Detailed Description

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

The Pearson colocalization, also known as Pearson correlation coefficient, is a linear correlation measure between the two input images InImg3d1 and InImg3d2. The result is a Real32 image where intensities belong to the range $ \left[ -1, 1 \right] $.

The Pearson correlation coefficient at each voxel is calculated with the following formula :

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

Where $ \textbf{x} = \left[ x, y, z \right] $ is the voxel coordinate vector, $ \mu_i, i \in [1, 2]$ is the mean intensity of $InImg3d_i$ and $\sigma_i$ is its standard deviation.

See Pearson colocalization mapping 2d for an illustration of Pearson colocalization mapping in two dimensions.

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.pearsonColocalization3dImg(inImg1, inImg2)
# Sample with a provided output image
outImg = PyIPSDK.createImage(PyIPSDK.eImageBufferType.eIBT_Real32, inImg1.getSizeX(), inImg1.getSizeY(), inImg1.getSizeZ())
filter.pearsonColocalization3dImg(inImg1, inImg2, outImg)

Example of C++ code :

Example informations

Header file

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

Code Example

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