IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Differential Interference Contrast (DIC) Phase Retrieval 2D

Phase retrieval from Paganin et al. 2004. More...

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::dicPhaseRetrieval2dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDev)
 wrapper function for Phase retrieval from Paganin et al. 2004 More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::dicPhaseRetrieval2dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDev, const ipReal64 mu, const ipReal64 delta, const ipReal64 defocusDistance)
 wrapper function for Phase retrieval from Paganin et al. 2004 More...
 
IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::dicPhaseRetrieval2dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDev, const ipReal64 mu, const ipReal64 delta, const ipReal64 defocusDistance, const ipReal64 lambda, const ipReal64 lengthScale, const ipReal64 energy)
 wrapper function for Phase retrieval from Paganin et al. 2004 More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::dicPhaseRetrieval2dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDev, const image::ImagePtr &pOutImg)
 wrapper function for Phase retrieval from Paganin et al. 2004 More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::dicPhaseRetrieval2dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDev, const ipReal64 mu, const ipReal64 delta, const ipReal64 defocusDistance, const image::ImagePtr &pOutImg)
 wrapper function for Phase retrieval from Paganin et al. 2004 More...
 
IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::dicPhaseRetrieval2dImg (const image::ImageConstPtr &pInImg, const ipReal32 inStdDev, const ipReal64 mu, const ipReal64 delta, const ipReal64 defocusDistance, const ipReal64 lambda, const ipReal64 lengthScale, const ipReal64 energy, const image::ImagePtr &pOutImg)
 wrapper function for Phase retrieval from Paganin et al. 2004 More...
 

Detailed Description

Phase retrieval from Paganin et al. 2004.

This algorithm is an implementation of Paganin's phase retrieval [1], used for Laplacian microscope imaging.

The calculation can be expressed by using the following formula:

\[ \phi[\textbf{x}] = -\frac{\delta}{\beta}ln\left(\mathcal{F}^{-1}\left( \frac{\mathcal{F} \left( I[\textbf{x}]/I_0[\textbf{x}] \right)}{F \frac{\delta}{\beta}\pi\left| \textbf{v} \right|^2 + 1} \right)\right) \]

where $I[\textbf{x}]$ and $\phi[\textbf{x}]$ are respectively the input and the result images at the coordinates $\textbf{x}$. $I_0[\textbf{x}]$ is the input image $I[\textbf{x}]$ smoothed by a Gaussian filter with standard deviation InStdDev. $\mathcal{F}$ is the Fourier transform operator, $\textbf{v}$ is the coordinates in the frequency domain, in $[-0.5, 0.5]^2$ and $F$ is the Fresnel number, calculated as:.

\[ F = \frac{defocusDist \times \lambda}{lengthscale^2} \]

By default the wavelength $\lambda$ is defined as $\lambda = \frac{12.4 \times 10^{-10}}{E}$ and $E$ is the energy, witch equals 13 by default, as suggested in the PyPhase implementation [2].

The other parameters are related to the microscope specifications:

Note
This algorithm and the Differential Interference Contrast (DIC) Integration 2D algorithm have different application. The Differential Interference Contrast (DIC) Integration 2D needs an oriented gradient as input image, whereas the phase retrieval algorithm uses an image acquired from a Laplacian microscope.

[1] Paganin D, Gureyev TE, Mayo SC, Stevenson AW, Nesterets YI, Wilkins SW. X-ray omni microscopy. J Microsc. 2004 Jun

[2] https://gitlab.in2p3.fr/mlanger/pyPhase/-/tree/master

Attributes description

Attribute description for algorithm :

Name ToolTip Default Initializer
ipsdk::imaproc::attr::InImg [Input] image for processing operation X
ipsdk::imaproc::attr::InStdDev [Input] standard deviation used for operation along all axis X
ipsdk::imaproc::filter::InDicPhaseRetrievalParams [Input] Attribute for the set of parameter used for the DIC phase retrieval algorithm X
ipsdk::imaproc::attr::OutWk1RealImg [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk1RealImg, _pInImg, ipsdk::image::eImageBufferType::eIBT_Real32)
ipsdk::imaproc::attr::OutWk2RealImg [Output] Temporary working image for algorithm ipsdk::imaproc::duplicateInOut (_pOutWk2RealImg, _pInImg, ipsdk::image::eImageBufferType::eIBT_Real32)
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,_pOutWk1RealImg) && 
ipsdk::imaproc::matchSize (_pInImg,_pOutWk2RealImg) && 
ipsdk::imaproc::matchSize (_pInImg,_pOutRealImg)

Example of Python code :

Example imports

import PyIPSDK
import PyIPSDK.IPSDKIPLFiltering as filter

Code Example

# opening of input images
inImg = PyIPSDK.loadTiffImageFile(inputImgPath)
# Calculation
outImg = filter.dicPhaseRetrieval2dImg(inImg, stdDev, 1000, 0.01, 0.001)

Example of C++ code :

Example informations

Associated library

IPSDKIPLFiltering

Header file

Code Example

// opening input image
ImagePtr pInImg = loadTiffImageFile(inImgPath);
// Set the parameters
const ipReal32 stdDev = 25.f;
const ipReal64 mu = 1000.;
const ipReal64 delta = 0.01;
const ipReal64 defocusDist = 0.001;
// compute the oriented integration
ImagePtr pOutImg = dicPhaseRetrieval2dImg(pInImg, stdDev, mu, delta, defocusDist);
See also
DicPhaseRetrieval2dImgLvl1
DicPhaseRetrieval2dImgLvl2

Function Documentation

◆ dicPhaseRetrieval2dImg() [1/6]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::dicPhaseRetrieval2dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDev 
)

wrapper function for Phase retrieval from Paganin et al. 2004

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ dicPhaseRetrieval2dImg() [2/6]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::dicPhaseRetrieval2dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDev,
const ipReal64  mu,
const ipReal64  delta,
const ipReal64  defocusDistance 
)

wrapper function for Phase retrieval from Paganin et al. 2004

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ dicPhaseRetrieval2dImg() [3/6]

IPSDKIPLFILTERING_API image::ImagePtr ipsdk::imaproc::filter::dicPhaseRetrieval2dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDev,
const ipReal64  mu,
const ipReal64  delta,
const ipReal64  defocusDistance,
const ipReal64  lambda,
const ipReal64  lengthScale,
const ipReal64  energy 
)

wrapper function for Phase retrieval from Paganin et al. 2004

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ dicPhaseRetrieval2dImg() [4/6]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::dicPhaseRetrieval2dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDev,
const image::ImagePtr pOutImg 
)

wrapper function for Phase retrieval from Paganin et al. 2004

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ dicPhaseRetrieval2dImg() [5/6]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::dicPhaseRetrieval2dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDev,
const ipReal64  mu,
const ipReal64  delta,
const ipReal64  defocusDistance,
const image::ImagePtr pOutImg 
)

wrapper function for Phase retrieval from Paganin et al. 2004

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure

◆ dicPhaseRetrieval2dImg() [6/6]

IPSDKIPLFILTERING_API void ipsdk::imaproc::filter::dicPhaseRetrieval2dImg ( const image::ImageConstPtr pInImg,
const ipReal32  inStdDev,
const ipReal64  mu,
const ipReal64  delta,
const ipReal64  defocusDistance,
const ipReal64  lambda,
const ipReal64  lengthScale,
const ipReal64  energy,
const image::ImagePtr pOutImg 
)

wrapper function for Phase retrieval from Paganin et al. 2004

Exceptions
ipsdk::processor::IPSDKBaseProcessingExceptionon failure