from pathlib import Path
import pickle


def load_properties_of_cropped(path: Path):
    """
    Load property file of after cropping was performed
    (files are name after case id and .pkl ending)
    
    Args:
        path (Path): path to file (if .pkl is missing, it will be added automatically)
    
    Returns:
        Dict: loaded properties
    """
    if not path.suffix == '.pkl':
        path = Path(str(path) + '.pkl')
    
    with open(path, 'rb') as f:
        properties = pickle.load(f)
    return properties