Module iaf.reg
Registration functions.
Functions
def apply_rigid_transform(A: numpy.ndarray, R: numpy.ndarray, t: numpy.ndarray)-
Applies rotation and translation to coordinates A.
Parameters
A:np.ndarray- Array of 2D or 3D source coordinates with shape [2xN] or [3xN]
R:np.ndarray- Rotation matrix (2x2 or 3x3).
t:np.ndarray- Translation vector (2x1 or 3x1)
Returns
A_t:np.ndarray- Array of 2D or 3D coordinates (shape [2xN] or [3xN]) transformed by rotation matrix R and translation vector t.
def find_rigid_transform(A: numpy.ndarray, B: numpy.ndarray, force_reflection: bool = False)-
Calculate rigid transformation to map coordinates A onto coordinates B.
Parameters
A:np.ndarray- Array of 2D or 3D source coordinates with shape [2xN] or [3xN]
B:np.ndarray- Array of 2D or 3D target coordinates A with shape [2xN] or [3xN]
force_reflection:bool- Whether to force reflection if one is suspected: it can give false positives (optional, default False).
Returns
R:np.ndarray- Rotation matrix (either 2x2 or 3x3) to transform the A coordinates into B.
t:np.ndarray- Translation vector (either 2x1 or 3x1) to transform the A coordinates into B.
def multi_image_alignment(images: list[numpy.ndarray], return_composites: bool = False) ‑> Union[tuple[list[numpy.ndarray], numpy.ndarray, numpy.ndarray], list[numpy.ndarray]]-
Registers (aligns) a series of images (translation only).
Parameters
images:list[np.ndarray]- List of 2D images to register. The first one will be used as template against which all others will be registered.
return_composites:bool = False- If True, returns two composites of the channels before and after alignment for quality control.
Returns
images:list[np.ndarray]- List of registered images.
rgb_before:np.ndarray- Composite of the channels before alignment.
rgb_after:np.ndarray- Composite of the channels after alignment.