import re


def mainpart (path):
    """
    Removes typical strings from file names of ultrasound files,
    which can be problematic for checking correspondence of
    ultrasound files, e.g. 'xxx_Track0' --> 'xxx'.
    """
    rmvs = ['_Track[0-9]+$', 'US$', '_corrected']
    for i in rmvs:
        path = re.sub(i, '', path)
    return path