Local Dynamic Range Compression (LDRC) Method

This module provides an option to compress the high dynamic range of high-order SOFI-reconstructed images.

High-order cumulant or moment reconstructions produce images with a large dynamic range for pixel intensities, making detailed features obscure. To overcome the problem, the ldrc algorithm rescales pixel intensities of high-order reconstructions based on a reference image. The compression is performed locally in a small window that scans across the original image. In each window, the pixel intensities of the original image are linearly rescaled so that they have the same dynamic range as the reference window.

Functions

pysofi.ldrc.ldrc(mask_im, input_im, order=1, window_size=[25, 25])

Process the image array with “local dynamic range compression” (ldrc).

Parameters
  • mask_im (ndarray) – A reference image. Usually a average/sum image or second-order SOFI image is used.

  • input_im (ndarray) – An input image, usually a high-order moment- or cumulant- reconstructed image.

  • order (int) – The order of the reconstructed image.

  • window_size ([int, int]) – The [x, y] dimension of the scanning window.

Returns

ldrc_im – The compressed image with the same dimensions of input_im.

Return type

ndarray

Notes

High-order cumulants or moments reconstructions result-in images with a large dynamic range of pixel intensities. This ldrc algorithm compresses the dynamic range of these reconstructions with respect to a reference image while retaining resolution enhancement. The compression is performed locally in a small window that is scanned across the image. For details of the ldrc method, see [1].

References

1

Xiyu Yi, Sungho Son, Ryoko Ando, Atsushi Miyawaki, and Shimon Weiss,

“Moments reconstruction and local dynamic range compression of high order superresolution optical fluctuation imaging,” Biomed. Opt. Express 10, 2430-2445 (2019).

Example

The reference image (second-order moment reconstruction), the input image that needs dynamic range compression, and the scanning window size is passed to the ldrc function:

ldrc_im = ldrc.ldrc(mask_im=d.moment_image(order=2), input_im=d.filtered, window_size=[25, 25])