def get_visualize_function(field: str) -> Callable:
    """Get the visualization function for a given field.

    This function retrieves the visualization function corresponding to a specified field
    from the current module. The function name is constructed by prepending
    ``visualize_`` to the field name.

    Args:
        field (str): Name of the visualization field. Common values include:
            - ``"image"``: For basic image visualization
            - ``"mask"``: For segmentation mask visualization
            - ``"anomaly_map"``: For anomaly heatmap visualization

    Returns:
        Callable: Visualization function corresponding to the given field.
            The returned function will accept parameters specific to that
            visualization type.

    Raises:
        AttributeError: If no visualization function exists for the specified
            ``field``. The error message will indicate which function name was
            not found.

    Examples:
        Get visualization function for an anomaly map:

        >>> from PIL import Image
        >>> visualize_func = get_visualize_function('anomaly_map')
        >>> anomaly_map = Image.new('F', (256, 256))
        >>> visualized_map = visualize_func(
        ...     anomaly_map,
        ...     colormap=True,
        ...     normalize=True
        ... )
        >>> isinstance(visualized_map, Image.Image)
        True

        Get visualization function for a mask:

        >>> visualize_func = get_visualize_function('mask')
        >>> mask = Image.new('1', (256, 256))
        >>> visualized_mask = visualize_func(mask, color=(255, 0, 0))
        >>> isinstance(visualized_mask, Image.Image)
        True

        Attempting to get function for invalid field raises error:

        >>> get_visualize_function('invalid_field')  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
            ...
        AttributeError: module 'anomalib.visualization.image.functional' has no
        attribute 'visualize_invalid_field'

    Note:
        - The function looks for visualization functions in the current module
        - Function names must follow the pattern ``visualize_{field}``
        - Each visualization function may have different parameters
        - All visualization functions return PIL Image objects
    """
    current_module = sys.modules[__name__]
    func_name = f"visualize_{field}"
    return getattr(current_module, func_name)
Get the visualization function for a given field.

    This function retrieves the visualization function corresponding to a specified field
    from the current module. The function name is constructed by prepending
    ``visualize_`` to the field name.

    Args:
        field (str): Name of the visualization field. Common values include:
            - ``"image"``: For basic image visualization
            - ``"mask"``: For segmentation mask visualization
            - ``"anomaly_map"``: For anomaly heatmap visualization

    Returns:
        Callable: Visualization function corresponding to the given field.
            The returned function will accept parameters specific to that
            visualization type.

    Raises:
        AttributeError: If no visualization function exists for the specified
            ``field``. The error message will indicate which function name was
            not found.

    Examples:
        Get visualization function for an anomaly map:

        >>> from PIL import Image
        >>> visualize_func = get_visualize_function('anomaly_map')
        >>> anomaly_map = Image.new('F', (256, 256))
        >>> visualized_map = visualize_func(
        ...     anomaly_map,
        ...     colormap=True,
        ...     normalize=True
        ... )
        >>> isinstance(visualized_map, Image.Image)
        True

        Get visualization function for a mask:

        >>> visualize_func = get_visualize_function('mask')
        >>> mask = Image.new('1', (256, 256))
        >>> visualized_mask = visualize_func(mask, color=(255, 0, 0))
        >>> isinstance(visualized_mask, Image.Image)
        True

        Attempting to get function for invalid field raises error:

        >>> get_visualize_function('invalid_field')  # doctest: +IGNORE_EXCEPTION_DETAIL
        Traceback (most recent call last):
            ...
        AttributeError: module 'anomalib.visualization.image.functional' has no
        attribute 'visualize_invalid_field'

    Note:
        - The function looks for visualization functions in the current module
        - Function names must follow the pattern ``visualize_{field}``
        - Each visualization function may have different parameters
        - All visualization functions return PIL Image objects
    
src/anomalib/visualization/image/functional.py