Skip to content

Focus: add "psd" method

Pierre Paleo requested to merge focus_psd into master

About

Follow-up of !64 (closed) (!).

To do

  • Implement PSD focus method
  • Unit tests
  • Update changelog/documentation

Notes

There was a slight discrepancy between octave-fasttomo3 and nabu for the focus distance estimation using psd.

After investigation it turns out that the azimuthal integration of Fourier spectrum is not done the same way as the one of imagej (used by octave (!)).

A dumb python translation (do_radial_distribution) was added and used as a reference. It provides good results but is quite slow (4 secs for each 2048x2048 image)!.
To speed up a little bit, we use scikit-image: polar transformation + summing. This is inaccurate but probably more than enough in our case.

AI method	Fourier options		Focus point diff (um)
--------------------------------------------------------------
nabu_old	|.|, "fourier"		-1.416
nabu_old	|.|^2, "fourier"	-1.206	
nabu_old	|.|, "direct"		-1.408
nabu_old	|.|^2, "direct"		-1.204
imagej		|.|			-0.1110
imagej		|.|^2			0.1949
skimage		|.|			-0.0976	
skimage		|.|^2			0.231
Edited by Pierre Paleo

Merge request reports

Loading