IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Normalized Cross-Correlation Measure 3d

measures the global Normalized Cross-Correlation between two 3D images More...

IPSDKIPLGLOBALMEASURE_API ipsdk::ipReal64 ipsdk::imaproc::glbmsr::normalizedCrossCorrelationMsr3d (const ipsdk::image::ImageConstPtr &pInImg3d1, const ipsdk::image::ImageConstPtr &pInImg3d2)
 wrapper function for measures the global Normalized Cross-Correlation between two 3D images More...
 

Detailed Description

measures the global Normalized Cross-Correlation between two 3D images

This algorithms computes the global Normalized Cross-Correlation (NCC) between the two input images. In opposition to the Normalized Cross-Correlation 3d algorithm which returns an image, the result of this algorithm is a a single scalar value.

The 3D NCC is calculated according to the following formula :

\[ NCC(InImg3d1(\textbf{x}), InImg3d2(\textbf{x})) = \frac{\sum_{\textbf{x} \in \Omega} (InImg3d1(\textbf{x}) - \overline{InImg3d1}) (InImg3d2(\textbf{x}) - \overline{InImg3d2}) } {\sqrt{\sum_{\textbf{x} \in \Omega} (InImg3d1(\textbf{x}) - \overline{InImg3d1})^2 \sum_{\textbf{x} \in \Omega} (InImg3d2(\textbf{x}) - \overline{InImg3d2})^2}} \]

Where $\Omega = (sizeX, sizeY, sizeZ)$ is the image domain definition.

The result belongs to $[-1, 1]$, and equals 1 when the images exactly matches, -1 when the images are exactly inverted and 0 when the images are totally different from each other.

If the input images has several slices along the C or T dimensions, the result is not a scalar but a collection of ipsdk::imaproc::attr::NCCResult. This data structure stores the actual result in its Result field. The other fields can be ignored as long as they are used for the calculation.

Please, see Normalized Cross-Correlation Measure 2d for an illustration of the global NCC in 2D case.

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg3d1 [Input] First 3d image for operation X
ipsdk::imaproc::attr::InImg3d2 [Input] Second 3d image for operation X
ipsdk::imaproc::attr::OutPINCCResult [Output] Plan indexed collection of NCC results ipsdk::imaproc::fromImageButVolume (_pOutPINCCResult, _pInImg3d1)

Global Rule description

Global rule description for algorithm :
ipsdk::imaproc::matchSize (_pInImg3d1,_pInImg3d2) && 
ipsdk::imaproc::matchImagePlans (_pOutPINCCResult,_pInImg3d1,eImagePlansMatchPolicy::eIPMP_CT)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLGlobalMeasure as glbmsr

Code Example

# retrieve measurement results
nccValue = glbmsr.normalizedCrossCorrelationMsr3d(inImg1, inImg2)
print("Global NCC value = " + str(nccValue))

Example of C++ code :

Example informations

Associated library

IPSDKIPLGlobalMeasure

Header file

Code Example

const ipReal64 ncc = normalizedCrossCorrelationMsr3d(pInImg1, pInImg2);
See also
NormalizedCrossCorrelationMsr3dLvl1
NormalizedCrossCorrelationMsr3dLvl2
NormalizedCrossCorrelationMsr3dLvl3

Function Documentation

◆ normalizedCrossCorrelationMsr3d()

IPSDKIPLGLOBALMEASURE_API ipsdk::ipReal64 ipsdk::imaproc::glbmsr::normalizedCrossCorrelationMsr3d ( const ipsdk::image::ImageConstPtr pInImg3d1,
const ipsdk::image::ImageConstPtr pInImg3d2 
)

wrapper function for measures the global Normalized Cross-Correlation between two 3D images

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure