"""
Preprocessing module for CORE

Contains preprocessing functions for WSI images including:
- Image loading and preprocessing
- Tissue mask extraction
- Nuclei detection and analysis
- Stain normalization
- Padding utilities
"""

from core.preprocessing.preprocessing import (
    load_wsi_images,
    preprocess_images,
    extract_tissue_masks,
    adjust_gamma,
    scale_transformation_matrix,
    load_slide,
    pad_single,
    pad_images_np,
    pad_to_same_size,
)

from core.preprocessing.nuclei_analysis import (
    extract_patches_from_wsi,
    detect_nuclei_patch_watershed,
    process_fixed_patch,
    process_moving_patch,
    process_nuclei_in_patches,
    save_nuclei_data_to_csv,
    load_nuclei_coordinates,
    extract_nuclei_points,
    subsample_nuclei,
    create_nuclei_dataframe_from_points,
)

from core.preprocessing.tissuemask import (
    FlorenceTissueMaskExtractor,
    UNetTissueMaskExtractor,
)

from core.preprocessing.stainnorm import StainNormalizer

from core.preprocessing.padding import (
    calculate_pad_value,
    apply_padding_landmarks,
    pad_image_src,
    pad_images,
    pad_landmarks,
    remove_padding,
)

__all__ = [
    # From preprocessing.py
    "load_wsi_images",
    "preprocess_images",
    "extract_tissue_masks",
    "adjust_gamma",
    "scale_transformation_matrix",
    "load_slide",
    "pad_single",
    "pad_images_np",
    "pad_to_same_size",
    
    # From nuclei_analysis.py
    "extract_patches_from_wsi",
    "detect_nuclei_patch_watershed",
    "process_fixed_patch",
    "process_moving_patch",
    "process_nuclei_in_patches",
    "save_nuclei_data_to_csv",
    "load_nuclei_coordinates",
    "extract_nuclei_points",
    "subsample_nuclei",
    "create_nuclei_dataframe_from_points",
    
    # From tissuemask.py
    "FlorenceTissueMaskExtractor",
    "UNetTissueMaskExtractor",
    
    # From stainnorm.py
    "StainNormalizer",
    
    # From padding.py
    "calculate_pad_value",
    "apply_padding_landmarks",
    "pad_image_src",
    "pad_images",
    "pad_landmarks",
    "remove_padding",
]
