"""
Registration module for CORE

Contains rigid and non-rigid registration algorithms for WSI alignment.
"""

from core.registration.registration import (
    perform_rigid_registration,
    perform_shape_aware_registration,
    find_mutual_nearest_neighbors,
    perform_cpd_registration,
    create_displacement_field,
    convert_4x4_to_3x3_transform,
    perform_icp_registration,
    HAS_OPEN3D,
)

from core.registration.rigid import (
    rigid_registration,
    Trimorph,
    XFeatReg,
    ShapeAwarePointSetRegistration,
    register_wsi_with_fine_tuning,
    extract_corresponding_tiles,
    perform_shape_aware_registration as perform_shape_aware_rigid,
)

from core.registration.nonrigid import (
    initialize_deformation_field,
    build_reference_coordinate_system,
    gaussian_smoothing,
    deformation_loss,
    scale_tensor_to_dimensions,
    compute_normalized_cross_correlation,
    apply_deformation_field,
    scale_deformation_field,
    create_multiscale_representation,
)

from core.registration.cpd import CPD

__all__ = [
    # From registration.py
    "perform_rigid_registration",
    "perform_shape_aware_registration",
    "find_mutual_nearest_neighbors",
    "perform_cpd_registration",
    "create_displacement_field",
    "convert_4x4_to_3x3_transform",
    "perform_icp_registration",
    
    # From rigid.py
    "rigid_registration",
    "Trimorph",
    "XFeatReg",
    "ShapeAwarePointSetRegistration",
    "register_wsi_with_fine_tuning",
    "extract_corresponding_tiles",
    "perform_shape_aware_rigid",
    
    # From nonrigid.py
    "initialize_deformation_field",
    "build_reference_coordinate_system",
    "gaussian_smoothing",
    "deformation_loss",
    "scale_tensor_to_dimensions",
    "compute_normalized_cross_correlation",
    "apply_deformation_field",
    "scale_deformation_field",
    "create_multiscale_representation",
    
    # From cpd.py
    "CPD",
]
