from pyaslreport.modalities import asl, testdsc
from .modalities.registry import get_processor

def generate_report(data):
    """
    Generates a report based on the provided data for a specific modality.
    The modality is determined from the 'modality' key in the data dictionary.
    :param data: Dictionary containing modality data, including the 'modality' key.
    :return: Report generated by the processor for the specified modality.
    """
    modality = data.get("modality")  # e.g., "asl", "dsc" and so on
    processor_class = get_processor(modality)
    processor = processor_class(data)

    return processor.process()
