def get_module(module_id, module_registry):
    """Obtains a configured ContourFeatures given an algorithm identificator.

    Parameters
    ----------
    module_id : str
        Module identificator (e.g., bitteli, melodia).
    module_registry : dict
        Dictionary of module_ids to class instances

    Returns
    -------
    module : object
        Object containing the selected module.
        None if no module is needed.
    """
    if module_id is None:
        return None
    try:
        module = module_registry[module_id]()
    except KeyError:
        raise RuntimeError("Algorithm %s can not be found in motif!" %
                           module_id)
    return module