module documentation
OpenFlexure Microscope autofocus module.
This module defines a Thing that is responsible for using the stage and camera together to perform an autofocus routine, and for collecting stacks of images (a 'z-stack').
See repository root for licensing information.
| Class | |
The Thing concerned with combinations of z axis movements and the camera. |
| Class | |
The information from a capture in a z_stack. |
| Class | |
A class with direct access to the CameraThing for monitoring the MJPEG stream. |
| Class | |
A BaseModel with the position and sharpness data from JPEGSharpnessMonitor. |
| Class | |
A class for holding for stack parameters, and returning computed ones. |
| Exception | |
No focus found during looping Autofocus. |
| Exception | |
The data to fit isn't a peak. |
| Exception | |
No images captured from stream. The camera is almost certainly not streaming. |
| Constant | EXTRA |
Undocumented |
| Constant | LOGGER |
Undocumented |
| Constant | MAX |
Undocumented |
| Constant | MIN |
Undocumented |
| Function | _count |
Count the number of turing points, after rejecting those from noise. |
| Function | _get |
Return the capture from a list of CaptureInfo objects with the matching id. |
| Function | _get |
Return the index of the capture with the matching id. |
| Function | _get |
Get the turning point for a sharpnesses in a z-stack. |
Return the capture from a list of CaptureInfo objects with the matching id.
| Parameters | |
captures:list[ | A list of capture objects |
bufferint | The buffer id of the image to return |
| Returns | |
CaptureInfo | the CaptureInfo object of the capture with matching id |
| Raises | |
ValueError | if buffer_id does not match the buffer_id of any captures |
Return the index of the capture with the matching id.
| Parameters | |
captures:list[ | A list of capture objects |
bufferint | The buffer id of the image to return |
| Returns | |
int | the list index of the capture with matching id |
| Raises | |
ValueError | if buffer_id does not match the buffer_id of any captures |
Get the turning point for a sharpnesses in a z-stack.
| Parameters | |
sharpnesses:np.ndarray | A numpy array of sharpnesses |
| Returns | |
float | The x value of the turning point where x-axis is 0 to N-1 for the N sharpness values |
| Raises | |
NotAPeakError | If the fit doesn't have a maximum within 95% confidence. |