Core Functions Reference
register_stack(image_stack, bbox, reference_slice=0, config=None):
Aligns a stack of images using template matching.
Arguments
- image_stack (
np.ndarray): 3D numpy array (slices, height, width) - bbox (
Tuple[int, int, int, int]): (x, y, w, h) tuple defining the template region - reference_slice (
int, default 0): Index of the reference slice - config (
AlignmentConfig, optional): Alignment configuration
Returns
- aligned_stack (
np.ndarray): 3D numpy array of aligned images - displacements (
List[Tuple[float, float]]): List of (dx, dy) tuples for each slice
Raises
ValueError: Ifimage_stackis not 3D orbboxis invalidIndexError: Ifreference_sliceis out of bounds
Example
aligned, displacements = register_stack(stack, bbox)
See also: StackAligner, AlignmentConfig