IPSDK 4.1.0.2
IPSDK : Image Processing Software Development Kit
Image Standardization
imagestandardizeImg (inImg)
imagestandardizeMaskImg (inImg,inOptMaskImg)

Detailed Description

Computes the z-score for each color plan and each frame.

This algorithm computes a standard score, also known as Z-score, for each pixel. The input image intensities are transformed in order to center them around 0 and rescale them according to the input image standard deviation. For each plan, along the color and temporal dimensions, the new intensities are calculated thanks to the following formula :

\[ OutRealImg[\textbf{x}] = \frac{InImg[\textbf{x}] - \mu}{\sigma} \]

Where $\textbf{x}$ is the pixel 2d or 3d coodinate (i.e. along the x, y and eventually z axis), $\mu$ is the mean intensity for a given color and temporal plan and $\sigma$ is the corresponding standard deviation.

Note
The output image has float data type.

Here is an example of a standardization on a UInt8 gray-level with their intensity ranges:

standardizeImg.png
See also
https://en.wikipedia.org/wiki/Standard_score

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLIntensityTransform as itrans

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# Z-score calculation
outImg = itrans.standardizeImg(inImg)

Example of C++ code :

Example informations

Header file

#include <IPSDKIPL/IPSDKIPLIntensityTransform/Processor/StandardizeImg/StandardizeImg.h>

Code Example

// Standardization without mask
// ============================
ImagePtr pOutImg = standardizeImg(pInImg);
// Standardization with mask
// ============================
ImagePtr pMaskedOutImg = standardizeMaskImg(pInImg, pMaskImg);