IPSDK 0.2
IPSDK : Image Processing Software Development Kit
Differential Interference Contrast (DIC) Phase Retrieval 2DSee full documentation
imagedicPhaseRetrieval2dImg (inImg,inStdDev)
imagedicPhaseRetrieval2dImg (inImg,inStdDev,mu,delta,defocusDistance)
imagedicPhaseRetrieval2dImg (inImg,inStdDev,mu,delta,defocusDistance,lambda,lengthScale,energy)

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

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

Header file

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

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);