"""
Cardiac Shared - Common utilities for cardiac imaging projects

This package provides shared IO, hardware detection, environment detection,
parallel processing, progress tracking, caching, configuration management,
and data registry for cardiac imaging analysis across multiple projects.

Modules:
- io: DICOM, NIfTI, and ZIP file handling
- hardware: Hardware detection and CPU optimization
- environment: Runtime environment detection
- parallel: Parallel processing with checkpoint support
- progress: Multi-level progress tracking
- cache: Result caching with resume capability
- batch: Batch processing framework
- config: YAML configuration management
- data: Intermediate results registry for cross-project sharing
"""

__version__ = "0.4.0"

# IO modules
from cardiac_shared.io.dicom import read_dicom_series, get_dicom_metadata
from cardiac_shared.io.nifti import load_nifti, save_nifti
from cardiac_shared.io.zip_handler import extract_zip, find_dicom_root

# Hardware detection
from cardiac_shared.hardware import (
    detect_hardware,
    HardwareInfo,
    GPUInfo,
    CPUInfo,
    RAMInfo,
    print_hardware_summary,
    get_optimal_config,
    CPUOptimizer,
    get_cpu_optimizer,
    apply_cpu_optimizations,
)

# Environment detection
from cardiac_shared.environment import (
    detect_runtime,
    RuntimeEnvironment,
    detect_colab,
    detect_wsl,
    print_environment_summary,
)

# Parallel processing
from cardiac_shared.parallel import (
    ParallelProcessor,
    ProcessingResult,
    Checkpoint,
    parallel_map,
    parallel_map_with_checkpoint,
)

# Progress tracking
from cardiac_shared.progress import (
    ProgressTracker,
    ProgressLevel,
    create_tracker,
)

# Cache management
from cardiac_shared.cache import CacheManager

# Batch processing
from cardiac_shared.batch import BatchProcessor, BatchConfig

# Configuration management
from cardiac_shared.config import ConfigManager, load_config

# Data registry
from cardiac_shared.data import (
    IntermediateResultsRegistry,
    RegistryEntry,
    get_registry,
)

__all__ = [
    # Version
    '__version__',

    # IO
    'read_dicom_series',
    'get_dicom_metadata',
    'load_nifti',
    'save_nifti',
    'extract_zip',
    'find_dicom_root',

    # Hardware
    'detect_hardware',
    'HardwareInfo',
    'GPUInfo',
    'CPUInfo',
    'RAMInfo',
    'print_hardware_summary',
    'get_optimal_config',
    'CPUOptimizer',
    'get_cpu_optimizer',
    'apply_cpu_optimizations',

    # Environment
    'detect_runtime',
    'RuntimeEnvironment',
    'detect_colab',
    'detect_wsl',
    'print_environment_summary',

    # Parallel
    'ParallelProcessor',
    'ProcessingResult',
    'Checkpoint',
    'parallel_map',
    'parallel_map_with_checkpoint',

    # Progress
    'ProgressTracker',
    'ProgressLevel',
    'create_tracker',

    # Cache
    'CacheManager',

    # Batch
    'BatchProcessor',
    'BatchConfig',

    # Config
    'ConfigManager',
    'load_config',

    # Data registry
    'IntermediateResultsRegistry',
    'RegistryEntry',
    'get_registry',
]
