magpack.image_utils.fourier_shell_correlation#

fourier_shell_correlation(img1, img2, half_bit=True, window=0.5, rgb=True)#

Compute the Fourier shell correlation (FSC) between two images.

Parameters:
img1, img2np.ndarray

First and second image as ndarray types.

half_bitbool, optional

If True, use the half-bit threshold; otherwise, use the one-bit threshold.

windowfloat, optional

Apply a Tukey window for non-periodic images.

rgbbool, optional

If True, process images as RGB.

Returns:
fscnp.ndarray

Fourier shell correlation curve.

thresholdnp.ndarray

Threshold curve

resolutionfloat

Resolution in pixels

Notes

The Fourier shell correlation is computed using the following equation:

\[C(r) = \frac{\Re\left\{\sum_{r_i \in r} F_1 (r_i) \cdot \sum_{r_i \in r} F_2 (r_i)^*\right\}} {\sqrt{\sum_{r_i \in r} |F_1 (r_i)|^2 \cdot \sum_{r_i \in r} |F_2 (r_i)|^2}}\]

Warning

This function has not been tested for N-dimensional input.