OpenFlexure Microscope API extension for stage calibration.
This file contains the HTTP API for camera/stage calibration. It includes calibration functions that measure the relationship between stage coordinates and camera coordinates, as well as functions that move by a specified displacement in pixels, perform closed-loop moves, and return the calibration data.
This module is only intended to be called from the OpenFlexure Microscope server, and depends on that server and its underlying LabThings library.
| Class | |
A Thing to manage mapping between image and stage coordinates. |
| Class | |
An Exception raised if camera stage mapping data is needed but unavailable. |
| Class | |
A named tuple containing the position over time for a single move. |
| Class | |
Call stage movement and maintain a record of position and time. |
| Function | csm |
Apply any CSM matrix to image coordinates. |
| Function | csm |
Apply any CSM matrix to stage coordinates to get image coordinates. |
| Function | _array |
Convert a numpy array into a tuple of ints. |
| Function | _serialise |
Undocumented |
np.ndarray | list[ list[ float]], *, x: float | int, y: float | int, **_kwargs: int) -> Mapping[ str, int]:
(source)
¶
Apply any CSM matrix to image coordinates.
x and y must be kwargs and extra kwargs are ignored, allowing: csm_img_to_stage(matrix, **position) to run for a mapping position.
Note that x and y are the actual (x, y) of the image, not the (m, n) indices used by numpy
| Parameters | |
matrix:np.ndarray | list[ | The matrix to use in the calculation |
x:float | int | the x image coordinate (keyword only) |
y:float | int | the y image coordinate (keyword only) |
**_kwargs:int | Undocumented |
| Returns | |
Mapping[ | The resulting stage coordinates as a mapping. |
np.ndarray | list[ list[ float]], *, x: float | int, y: float | int, **_kwargs: int) -> Mapping[ str, float]:
(source)
¶
Apply any CSM matrix to stage coordinates to get image coordinates.
x and y must be kwargs and extra kwargs are ignored, allowing: csm_img_to_stage(matrix, **position) to run for a mapping position.
Note that x and y are the actual (x, y) of the image, not the (m, n) indices used numpy
| Parameters | |
matrix:np.ndarray | list[ | The matrix to use in the calculation |
x:float | int | the x stage coordinate (keyword only) |
y:float | int | the y stage coordinate (keyword only) |
**_kwargs:int | Undocumented |
| Returns | |
Mapping[ | The resulting img coordinates as a mapping. |