import re


def _split_sythentic_img_name(name):
    """Split the synthetic naming convention into several parts.

    This function will parse the image name to extract the group of the
    synthetic.

    :param name: file name to parse
    :returns: string -- the group of the synthetic.
    """
    group_regex = re.compile(r'(test_Mix_DPerc\d+_c)_\d+\.dcm')
    img_regex = re.compile(r'(phMix\d+)_c_\d+\.dcm')

    group_match = re.match(group_regex, name)
    img_match = re.match(img_regex, name)
    if group_match:
        return group_match.group(1)
    elif img_match:
        return img_match.group(1)