class documentation

class StackParams(BaseModel): (source)

View In Hierarchy

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

Class Method check_images_to_save Verify that the images to save parameter is positive and odd.
Class Method check_images_to_test Verify that the images to test parameter matches various constraints.
Method check_image_limits Ensure the number of images to save isn't more than the minimum tested.
Method slice_to_save Return the slice of images to save given the index of the sharpest image.
Class Variable autofocus_dz Undocumented
Class Variable backlash_correction Distance (in steps) to overshoot a move and then undo, to account for backlash
Class Variable images_dir Undocumented
Class Variable images_to_save Undocumented
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 min_images_to_test Undocumented
Class Variable save_resolution Undocumented
Class Variable settling_time Time (in seconds) between moving and capturing an image
Class Variable stack_dz Undocumented
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
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.
@field_validator('images_to_save')
@classmethod
def check_images_to_save(cls, images_to_save: int) -> int: (source)

Verify that the images to save parameter is positive and odd.

@field_validator('min_images_to_test')
@classmethod
def check_images_to_test(cls, min_images_to_test: int) -> int: (source)

Verify that the images to test parameter matches various constraints.

@model_validator(mode='after')
def check_image_limits(self) -> StackParams: (source)

Ensure the number of images to save isn't more than the minimum tested.

def slice_to_save(self, sharpest_index: int) -> slice: (source)

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

autofocus_dz: int = (source)

Undocumented

backlash_correction: int = (source)

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

images_dir: str = (source)

Undocumented

images_to_save: int = (source)

Undocumented

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

min_images_to_test: int = (source)

Undocumented

save_resolution: tuple[int, int] = (source)

Undocumented

settling_time: float = (source)

Time (in seconds) between moving and capturing an image

stack_dz: int = (source)

Undocumented

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

@computed_field
@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.

@computed_field
@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.

@computed_field
@property
steps_undershoot: int = (source)

The distance to deliberately undershoot the estimated optimal starting point.