DigitalHolography / Holovibes

Real time, high throughput digital holography software
https://holovibes.com/
Apache License 2.0
17 stars 3 forks source link

Add the possibility to record the moments #524

Open noTban opened 1 month ago

noTban commented 1 month ago

For the moment, here is the typical pipeline to obtain the blood flow in the retina's blood vessels :

  1. Use the real-time visualisation of the eye with Holovibes to get a good focus on the eye of the patient, and then record the high throughput of the camera with Holovibes. The calculus to obtain a real-time visualisation is usually a spatial fourier transform (fresnel transform) followed by a PCA. Those computations don't enable to access the moments and the doppler shift enabling the estimation of the blood flow.

  2. Load the interferograms in Holowaves (Matlab), and then pursue the following computations :

    • Fresnel transformation to propagate the signal in the retina's plane
    • apply SVD filtering on the matrix formed by the sequence of flattened frames (grouped by batches of usually 512 frames). This operation takes out the first singular components corresponding to reflection noise.
    • STFT : FFT time fourier transform on the resulting grouped batch matrices
    • On the frequency signal obtained from the STFT, compute the moment 0, moment 1 and moment 2. For a complex signal with fequencies $$f$$ going from $$-\infty$$ to $$+\infty$$, a moment $$m$$ of order $$k$$ will be equal to $$mk=\int\limits{-\infty}^{\infty}f^kX(f)df$$. To remove signal parts cause by movements of the eye we select frequencies via parameters $f_1$ and $f_2$ and calculate $$mk=\int\limits{-f_2}^{-f1}f^kX(f)df + \int\limits{f_1}^{f_2}f^kX(f)df$$ for $k=0,1,2$.
  3. In PulseWave (MatLab), by using the moments, a segmentation mask is computed, as well as the doppler shift in the vessels. This doppler shift allows to estimate the blood velocity. Then, the blood flow is estimated using he blood velocity and the estimated volume of the vessels deducted from the diameter of the segmented mask.

In this pipeline, the longest step is by far the second one. We would like to use the performance of Holovibes to accelerate this step ; by incorporating it to the CLI, we could even use the ProcessHoloFiles.ps1 to automatically generate the moments for all the interferograms stored in a directory.

Here are the steps to achieve such a dream :

simon-riou commented 1 month ago

In the branch fix_write_moments:

Question: