class documentation
class FinalStitcher(BaseStitcher): (source)
Constructor: FinalStitcher(images_dir, logger, overlap, correlation_resize, ...)
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 |
Log everything in the buffer at INFO level. |
| Method | run |
Run the final stitch logging any output. |
| Instance Variable | logger |
Undocumented |
| Method | _log |
Log the ongoing process unless it is cancelled. |
| Method | _process |
Process inputs to ensure overlap and correlation_resize have values. |
| Instance Variable | _extra |
Undocumented |
| Instance Variable | _mode |
Undocumented |
Inherited from BaseStitcher:
| Method | validate |
Check path is safe before making a command to run with subprocess. |
| Instance Variable | correlation |
Undocumented |
| Instance Variable | images |
Undocumented |
| Instance Variable | min |
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 | The images directory of the scan to stitch. |
logger:lt.deps.InvocationLogger | The invocation logger for this stitch process. |
overlap:float | None | The 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. |
correlationfloat | None | The 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. |
stitchbool | Whether to stitch a pyramidal TIFF. |
scandict[ | The ScanData for this scan as a dictionary. This is used to read/calculate overlap and correlation_resize if they are not provided. |
Run the final stitch logging any output.
| Raises | |
ChildProcessError | if exit code is not zero |
InvocationCancelledError | if the action 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:float | overlap as input to __init__ |
correlationfloat | correlation_resize as input to __init__ |
scandict[ | scan_data_dict as input to __init__ |
| Returns | |
tuple[ | overlap and correlation_resize as floats. |