module documentation

Communicate with OpenFlexure Stitching to perform stitches for scans.

This includes both live stitching and final stitching. This is done via subprocess to call openflexure-stitching over CLI. This cannot be done via Threading due to the CPU intensity of stitching causing scanning problems due to the Python Global Interpreter Lock (GIL). May be possible to shift to multiprocessing in the future.

Class BaseStitcher A base stitching class for all stitchers. Don't initialise this directly.
Class FinalStitcher A class to handle the final stitch for a scan.
Class PreviewStitcher A stitcher for stitching an ongoing scan in preview mode.
Exception ExternalSigkillError Exception called when stitch is killed by an external process calling Sigkill.
Exception StitcherValidationError The stitcher received values that it deems unsafe to create a command from.
Function validate_command Validate that the command only characters that are allowed in a path.
Constant DEFAULT_OVERLAP Undocumented
Constant DEFAULT_RESIZE Undocumented
Constant STITCH_TILE_SIZE Undocumented
Constant STITCHING_CMD Undocumented
Constant STITCHING_RESOLUTION Undocumented
def validate_command(cmd: list[str]): (source)

Validate that the command only characters that are allowed in a path.

The values in the commands should be numbers, commandline flags, paths, and executables. All of these should be allowed by make_path_safe.

Raises
StitcherValidationErrorif any element in the command is not safe.
DEFAULT_OVERLAP: float = (source)

Undocumented

Value
0.1
DEFAULT_RESIZE: float = (source)

Undocumented

Value
0.5
STITCH_TILE_SIZE: int = (source)

Undocumented

Value
8192
STITCHING_CMD: str = (source)

Undocumented

Value
'openflexure-stitch'
STITCHING_RESOLUTION: tuple[int, ...] = (source)

Undocumented

Value
(820, 616)