find_focus_plane

shampoo.find_focus_plane(roi_cube, focus_on=u'amplitude', plot=False)[source] [edit on github]

Find focus plane in a cube of reconstructed waves at different propagation distances.

Uses the autofocus method of Dubois et al. 2006 who showed that the integral over the image plane of the amplitude of the reconstructed wave is minimum at the focal plane for a pure amplitude object [R4]. This will only work for small cubes centered on the specimen.

[R4]https://www.osapublishing.org/oe/abstract.cfm?uri=oe-14-13-5895
Parameters:

roi_cube : ndarray

Reconstructed waves at N propagation distances with M by M pixels, with a shape of (N, M, M)

focus_on : {“amplitude”, “phase”} (optional)

Focus on the phase or amplitude?

plot : bool (optional)

Make plots of the integral of the amplitude of the reconstructed wave as a function of distance. Default is False.

Returns:

focus_index : int

Index of the z-plane that is in focus

significance : float

Significance of a detection of a particle in the ROI cube, measured by the significance of the negative peak in the derivative of the sum of the unwrapped phase in the image plane, with respect to propagation distance. For example, if significance < 3 the detection of a specimen may be legitimate.