3D PSF Auto-centering/centroiding
Is there a formula for shifting the 3D PSF so that the "peak" / "center of mass" is aligned at the 3D volume origin?
In order words, how do I determine the focal plane and the optimal immersion medium thickness?
I tried modifying the coefficient C2 to C2 = C2 - C1 - C3 in order to null out the OPD at the Z-stage's zero position z0, but I don't feel the Math is rigorous enough.
https://github.com/MicroscPSF/MicroscPSF-Matlab/blob/0ce640dbab71fdf4f0e7267091189e2a09e239d6/MicroscPSF.m#L170
I am also okay to write a golden peak searching algorithm to achieve the same goal: minimizing the PSF 3D centroid distance (x0, y0, z0) from the origin (0, 0, 0) in the Z-stage's reference frame, by searching along immersion medium thickness ti. It is simply not elegant enough.