A class used to measure the range of motion of the stage in X and Y.
| Method | __init__ |
Initialise and create the lock. |
| Method | perform |
Measures the range of motion of the stage across the x and y axes. |
| Instance Variable | calibrated |
Undocumented |
| Method | _big |
Take one big move with feed-forward z-correction. |
| Method | _img |
For a given image percentage and axis return the distance in img coords. |
| Method | _initial |
Perform 5 medium sized moves with autofocus for z feed-forward. |
| Method | _move |
Move the stage and measure the offset between the two positions. |
| Method | _move |
Move the stage against the direction of test unil motion is detected. |
| Method | _move |
Move in one direction until movement per step decreases significantly. |
| Method | _movement |
Return the dictionary for a move in image coordinates. |
| Method | _offset |
Take an image and calculate the offset from an input image. |
| Method | _set |
Set the self._stream_resolution attribute by reading camera. |
| Method | _stage |
Carry out 3 small moves in a given direction and axis. |
| Instance Variable | _lock |
Undocumented |
| Instance Variable | _rom |
Undocumented |
| Instance Variable | _stream |
Undocumented |
AutofocusDep, stage: StageDep, cam: CamDep, csm: CSMDep, logger: lt.deps.InvocationLogger) -> dict[ str, Any]:
(source)
¶
Measures the range of motion of the stage across the x and y axes.
| Parameters | |
autofocus:AutofocusDep | A raw_thing_client dependency for autofocus. |
stage:StageDep | A raw_thing_client depeendency for the microscope stage. |
cam:CamDep | A raw_thing_client depeendency for the camera. |
csm:CSMDep | A raw_thing_client depeendency for camera stage mapping. |
logger:lt.deps.InvocationLogger | A raw_thing_client depeendency for the logger. |
| Returns | |
dict[ | Results dictionary separated into keys of each axis and direction. |
Literal[ 'x', 'y'], direction: Literal[ 1, -1], rom_deps: RomDeps):
(source)
¶
Take one big move with feed-forward z-correction.
The size is defined by the BIG_STEP constant.
| Parameters | |
axis:Literal[ | The axis to move in. |
direction:Literal[ | The direction to move in. |
romRomDeps | All dependencies that were passed to the calling Action |
int, axis: Literal[ 'x', 'y']) -> float:
(source)
¶
For a given image percentage and axis return the distance in img coords.
| Parameters | |
fovint | The percentage of field of view the stage should move by. |
axis:Literal[ | The resolution of the stream from the camera. |
| Returns | |
float | Distance in image coordinates (pixels) |
Literal[ 'x', 'y'], direction: Literal[ 1, -1], rom_deps: RomDeps):
(source)
¶
Perform 5 medium sized moves with autofocus for z feed-forward.
z-feed forward allows prediction of the z-position as the stage moves. For the feed forward calculation to work an initial number of measurements must be taken. This method performs these initial measurements.
| Parameters | |
axis:Literal[ | The axis which is being measured. This must be 'x' or 'y'. |
direction:Literal[ | The direction the stage moves. |
romRomDeps | All dependencies that were passed to the calling Action |
dict[ str, float], rom_deps: RomDeps, perform_autofocus: bool = True, max_autofocus_repeats: int = 0, abs_min_offset: float = 0.0) -> dict[ str, float]:
(source)
¶
Move the stage and measure the offset between the two positions.
| Parameters | |
movement:dict[ | A dictionary containing the distance to move in image coords. |
romRomDeps | All dependencies that were passed to the calling Action |
performbool | Set to False to disable autofocus after move. Default is True |
maxint | The number of times to repeat the focus if the detected (on-axis) offset is below abs_min_offset. This will only work if abs_min_offset is also set |
absfloat | The absolute minimum (on-axis) offset, under which the autofocus is repeated. |
| Returns | |
dict[ | The calculated offset from cross correlation. |
Literal[ 'x', 'y'], direction: Literal[ 1, -1], rom_deps: RomDeps):
(source)
¶
Move the stage against the direction of test unil motion is detected.
In the case that the stage has reached the end of the motion, this method moves the motor in the opposite direction until reliable motion is detected.
| Parameters | |
axis:Literal[ | The axis in which the stage is moving. This must be 'x' or 'y'. |
direction:Literal[ | The direction in which the stage was moving during the test, this method will move in the opposite direction. |
romRomDeps | All dependencies that were passed to the calling Action |
Literal[ 'x', 'y'], direction: Literal[ 1, -1], rom_deps: RomDeps):
(source)
¶
Move in one direction until movement per step decreases significantly.
This should move until the edge of the stage. Once the edge is reached there will be some movement as there is no hard stop, but it will reduce significantly.
| Parameters | |
axis:Literal[ | The axis which is being measured. This must be 'x' or 'y'. |
direction:Literal[ | The direction which is being measured. This must be 1 or -1. |
romRomDeps | All dependencies that were passed to the calling Action |
| Returns | |
| Results dictionary containing stage positions, correlations and the final position. |
int, axis: Literal[ 'x', 'y'], direction: Literal[ 1, -1]) -> dict[ str, float]:
(source)
¶
Return the dictionary for a move in image coordinates.
This dictionary can be passed directly to csm.move_in_image_coordinates
| Parameters | |
fovint | The percentage of field of view the stage should move by. |
axis:Literal[ | The resolution of the stream from the camera. |
direction:Literal[ | The direction the stage moves. |
| Returns | |
dict[ | The movement size in image coordinates |
Take an image and calculate the offset from an input image.
| Parameters | |
beforenp.ndarray | The image the offset should be calculated with respect to. |
romRomDeps | All dependencies that were passed to the calling Action |
| Returns | |
dict[ | The calculated offset as a dictionary in pixels |
Set the self._stream_resolution attribute by reading camera.
| Parameters | |
cam:CamDep | The camera dependency. |
Literal[ 'x', 'y'], direction: Literal[ 1, -1], rom_deps: RomDeps) -> bool:
(source)
¶
Carry out 3 small moves in a given direction and axis.
An image is taken before and after each move to check the stage has moved as far as it should. If the offset (calculated by cross correlation) is less than expected, 3 attempts are made to refocus the image to ensure that image quality is not causing the offset to mistakenly be reported as a low value. If the calculated offset is still too low then this is taken as an indication that the edge has been found.
| Parameters | |
axis:Literal[ | The axis which is being measured. This must be 'x' or 'y'. |
direction:Literal[ | The direction the stage moves. |
romRomDeps | All dependencies that were passed to the calling Action |
| Returns | |
bool | Undocumented |