class documentation

A class for holding for stack parameters, and returning computed ones.

Method __init__ Initialise the parameters. All arguments are keyword only.
Method slice_to_save Return the slice of images to save given the index of the sharpest image.
Class Variable backlash_correction Distance (in steps) to overshoot a move and then undo, to account for backlash
Class Variable img_undershoot How far below (in factors of stack_dz) the estimated optimal starting position to begin the stack. Better to start slightly too low and require many images, rather than too high and needing to autofocus and restart the stack...
Class Variable max_attempts Maximum number of times to attempt fast stack
Class Variable settling_time Time (in seconds) between moving and capturing an image
Class Variable stack_height_limit How many images can be appended to the stack after the predicted peak to test for focus before assuming the focus was passed, and restarting the stack
Instance Variable autofocus_dz Undocumented
Instance Variable images_dir Undocumented
Instance Variable images_to_save Undocumented
Instance Variable min_images_to_test Undocumented
Instance Variable save_resolution Undocumented
Instance Variable stack_dz Undocumented
Property max_images_to_test The maximum number of images that will be captured and tested in a stack.
Property stack_z_range The range of the z stack, in steps.
Property steps_undershoot The distance to deliberately undershoot the estimated optimal starting point.
def __init__(self, *, stack_dz: int, images_to_save: int, min_images_to_test: int, autofocus_dz: int, images_dir: str, save_resolution: tuple[int, int]): (source)

Initialise the parameters. All arguments are keyword only.

Parameters
stack_dz:intThe number of motor steps between images
images_to_save:intThe number of images to save to disk
min_images_to_test:intThe minimum number of images in the stack before, the stack is evaluated for focus. As more images are captured evaluation of the focus is always evaluated with the same number of images. i.e. if min_images_to_test=9, then 9 images are captured, if the stack is not well focused, a 10th image is captured and images 2 to 10 are evaluated for focus
autofocus_dz:intThe number of steps in a full autofocus (when required)
images_dir:strThe directory to save images to disk
save_resolution:tuple[int, int]The resolution to save the captures to disk with
def slice_to_save(self, sharpest_index): (source)

Return the slice of images to save given the index of the sharpest image.

backlash_correction: int = (source)

Distance (in steps) to overshoot a move and then undo, to account for backlash

img_undershoot: int = (source)

How far below (in factors of stack_dz) the estimated optimal starting position to begin the stack. Better to start slightly too low and require many images, rather than too high and needing to autofocus and restart the stack

max_attempts: int = (source)

Maximum number of times to attempt fast stack

settling_time: float = (source)

Time (in seconds) between moving and capturing an image

stack_height_limit: int = (source)

How many images can be appended to the stack after the predicted peak to test for focus before assuming the focus was passed, and restarting the stack

autofocus_dz = (source)

Undocumented

images_dir = (source)

Undocumented

images_to_save = (source)

Undocumented

min_images_to_test = (source)

Undocumented

save_resolution = (source)

Undocumented

stack_dz = (source)

Undocumented

@property
max_images_to_test: int = (source)

The maximum number of images that will be captured and tested in a stack.

This is 15 images more then the minimum number that are captured.

@property
stack_z_range: int = (source)

The range of the z stack, in steps.

Note that this is the range of the minimum number of images captured, which is also the range of the images stored in memory that can be saved.

@property
steps_undershoot: int = (source)

The distance to deliberately undershoot the estimated optimal starting point.