Update stiching to differentiate bwtween stitchers that use a thread and those that block
This commit is contained in:
parent
5f092835ac
commit
cd311f08bf
3 changed files with 11 additions and 18 deletions
|
|
@ -44,7 +44,12 @@ def validate_command(cmd: list[str]):
|
|||
|
||||
|
||||
class BaseStitcher:
|
||||
"""A base stitching class for all stitchers. Don't initialise this directly."""
|
||||
"""A base stitching class for all stitchers. Don't initialise this directly.
|
||||
|
||||
The base class has no way to run the command. Child classes should either implement
|
||||
a ``start``, ``running``, and ``wait`` methods if they stitch in a thread, or ``run``
|
||||
if they stitch in this thread and return once complete.
|
||||
"""
|
||||
|
||||
def __init__(self, images_dir: str, *, overlap: float, correlation_resize: float):
|
||||
"""Initialise a stitcher.
|
||||
|
|
@ -104,15 +109,6 @@ class BaseStitcher:
|
|||
"Invalid directory path: Contains unsafe characters."
|
||||
)
|
||||
|
||||
def start(self) -> None:
|
||||
"""Start stitching a stitching process.
|
||||
|
||||
This should be overridden by any child class.
|
||||
"""
|
||||
raise NotImplementedError(
|
||||
"Child stitchers should implement their own ``start`` method."
|
||||
)
|
||||
|
||||
|
||||
class PreviewStitcher(BaseStitcher):
|
||||
"""A stitcher for stitching an ongoing scan in preview mode.
|
||||
|
|
@ -262,7 +258,7 @@ class FinalStitcher(BaseStitcher):
|
|||
)
|
||||
return overlap, correlation_resize
|
||||
|
||||
def start(
|
||||
def run(
|
||||
self,
|
||||
cancel: lt.deps.CancelHook,
|
||||
) -> None:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue