class documentation

A class to handle the final stitch for a scan.

Method __init__ Initialise a final stitcher, this has more args than the base class.
Method log_buffer Log everything in the buffer at INFO level.
Method run Run the final stitch logging any output.
Instance Variable logger Undocumented
Method _log_ongoing Log the ongoing process unless it is cancelled.
Method _process_inputs Process inputs to ensure overlap and correlation_resize have values.
Instance Variable _extra_args Undocumented
Instance Variable _mode Undocumented

Inherited from BaseStitcher:

Method validate_path Check path is safe before making a command to run with subprocess.
Instance Variable correlation_resize Undocumented
Instance Variable images_dir Undocumented
Instance Variable min_overlap Undocumented
Property command The command to run with subprocess.Popen.
def __init__(self, images_dir, *, logger: lt.deps.InvocationLogger, overlap: float | None = None, correlation_resize: float | None = None, stitch_tiff: bool = False, scan_data_dict: dict[str, Any] | None = None): (source)

Initialise a final stitcher, this has more args than the base class.

All args except images_dir are positional only.

Parameters
images_dirThe images directory of the scan to stitch.
logger:lt.deps.InvocationLoggerThe invocation logger for this stitch process.
overlap:float | NoneThe scan overlap, if not known enter None. A value will be chosen from the scan_data_dict, or set to a default value if no value is available in the scan_data.
correlation_resize:float | NoneThe fraction to resize images by when correlating, if not known enter None. A value will be chosen from the scan_data_dict, or set to a default value if no value is available in the scan_data.
stitch_tiff:boolWhether to stitch a pyramidal TIFF.
scan_data_dict:dict[str, Any] | NoneThe ScanData for this scan as a dictionary. This is used to read/calculate overlap and correlation_resize if they are not provided.
def log_buffer(self, buffer: TextIOWrapper): (source)

Log everything in the buffer at INFO level.

def run(self, cancel: lt.deps.CancelHook): (source)

Run the final stitch logging any output.

Raises
ChildProcessErrorif exit code is not zero
InvocationCancelledErrorif the action is cancelled.

Undocumented

def _log_ongoing(self, process: subprocess.Popen, cancel: lt.deps.CancelHook): (source)

Log the ongoing process unless it is cancelled.

def _process_inputs(self, overlap: float, correlation_resize: float, scan_data_dict: dict[str, Any] | None) -> tuple[float, float]: (source)

Process inputs to ensure overlap and correlation_resize have values.

First the scan_data_dict is inspected for values to allow overlap and correlation_resize to be set correctly, if these values are not available then default values are used, and a warning is logged to the invocation logger.

Parameters
overlap:floatoverlap as input to __init__
correlation_resize:floatcorrelation_resize as input to __init__
scan_data_dict:dict[str, Any] | Nonescan_data_dict as input to __init__
Returns
tuple[float, float]overlap and correlation_resize as floats.