ess.imaging.tools.resolution.modulation_transfer_function#
- ess.imaging.tools.resolution.modulation_transfer_function(measured_image, open_beam_image, target)[source]#
Computes the modulation transfer function (MTF) of the camera given a measured image and the ideal image that would have been captured if the instrument had infinite resolution.
- Parameters:
- Returns:
DataArray– The modulation transfer function as a function of “frequency” representing “line pairs” per pixel.
Notes
Computing modulation transfer function (MTF)#
The definition of the MTF is
\[\mathrm{MTF}(f) = |\mathcal{F}(P)|\]where \(\mathcal{F}(P)\) is the Fourier transform of the point spread function \(P\).
The Fourier transform of the point spread function is really a function of two variables, but it is assumed that the MTF does not vary depending on the direction of change, so here it’s denoted as a function of the frequency independent of direction:
\[\mathrm{MTF}(\|(f_x, f_y)\|) = |\mathcal{F}(P)|(f_x, f_y)\]Model for images in detector#
The intensity distribution in the detector (the “image”) \(I\) is modeled as
\[I = I_0 S \star P\]where \(I_0\) is the intensity distribution at the sample, \(S\) is the transmission function of the sample, and \(P\) is the point-spread function.
For the open beam we don’t have any sample and the intensity distribution in the detector is modeled as
\[I_{ob} = I_0 \star P\]Approximation#
Assuming \(I_0\) is more or less uniform, and \(P\) is relatively localized, we can approximate
\[I_0 \star P \approx I_0\]Making this assumption we can substitute \(I_0\) for \(I_{ob}\) in the model for the image:
\[I = I_{ob} S \star P\]Applying the Fourier transform on both sides we have
\[\mathcal{F}(I) = \mathcal{F}(I_{ob} S)\, \mathcal{F}(P)\]which implies
\[|\mathcal{F}(P)| = \left| \frac{\mathcal{F}(I)}{\mathcal{F}(I_{ob} S)} \right|\]and therefore
\[\mathrm{MTF}(\|(f_x, f_y)\|) = \frac{|\mathcal{F}(I)|(f_x, f_y)}{|\mathcal{F}(I_{ob} S)|(f_x, f_y)}\]Finally, integrating over constant frequency magnitude:
\[\mathrm{MTF}(f) = \frac{\int_{\|(f_x, f_y)\| = f} |\mathcal{F}(I)|(f_x, f_y)\, df_x\, df_y} {\int_{\|(f_x, f_y)\| = f} |\mathcal{F}(I_{ob} S)|(f_x, f_y)\, df_x\, df_y}\]Conclusion#
The modulation transfer function at frequency \(f\) can be estimated as the ratio of the Fourier transform of the image (integrated over constant frequency magnitude) to the Fourier transform of the open beam image multiplied by the sample mask (also integrated over constant frequency magnitude).