IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit

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

IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::standardizeImg (const ipsdk::image::ImageConstPtr &pInImg)
 wrapper function for Computes the z-score for each color plan and each frame More...
 
IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::standardizeImg (const ipsdk::image::ImageConstPtr &pInImg, const ipsdk::image::ImagePtr &pOutRealImg)
 wrapper function for Computes the z-score for each color plan and each frame More...
 
IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::standardizeMaskImg (const ipsdk::image::ImageConstPtr &pInImg, const ipsdk::image::ImageConstPtr &pInOptMaskImg)
 wrapper function for Computes the z-score for each color plan and each frame using a mask More...
 
IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::standardizeMaskImg (const ipsdk::image::ImageConstPtr &pInImg, const ipsdk::image::ImageConstPtr &pInOptMaskImg, const ipsdk::image::ImagePtr &pOutRealImg)
 wrapper function for Computes the z-score for each color plan and each frame using a mask More...
 

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

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InOptMaskImg [Input Optional] Binary image for masking operation X
ipsdk::imaproc::attr::OutRealImg [Output] image for processing operation (data contained in image buffer are reals) ipsdk::imaproc::duplicateInOut (_pOutRealImg, _pInImg, ipsdk::image::eImageBufferType::eIBT_Real32)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg,_pOutRealImg) && 
ipsdk::processor::ifIsSet (_pInOptMaskImg,
 ipsdk::imaproc::matchSize (_pInImg,_pInOptMaskImg))

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

Associated library

IPSDKIPLIntensityTransform

Header file

Code Example

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

Function Documentation

◆ standardizeImg() [1/2]

IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::standardizeImg ( const ipsdk::image::ImageConstPtr pInImg)

wrapper function for Computes the z-score for each color plan and each frame

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ standardizeMaskImg() [1/2]

IPSDKIPLINTENSITYTRANSFORM_API ipsdk::image::ImagePtr ipsdk::imaproc::itrans::standardizeMaskImg ( const ipsdk::image::ImageConstPtr pInImg,
const ipsdk::image::ImageConstPtr pInOptMaskImg 
)

wrapper function for Computes the z-score for each color plan and each frame using a mask

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ standardizeImg() [2/2]

IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::standardizeImg ( const ipsdk::image::ImageConstPtr pInImg,
const ipsdk::image::ImagePtr pOutRealImg 
)

wrapper function for Computes the z-score for each color plan and each frame

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ standardizeMaskImg() [2/2]

IPSDKIPLINTENSITYTRANSFORM_API void ipsdk::imaproc::itrans::standardizeMaskImg ( const ipsdk::image::ImageConstPtr pInImg,
const ipsdk::image::ImageConstPtr pInOptMaskImg,
const ipsdk::image::ImagePtr pOutRealImg 
)

wrapper function for Computes the z-score for each color plan and each frame using a mask

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure