import json


def loadJsonArgs(fn):
    """
    Load the .json file containing input values

    Args:
        fn: file name
    Returns:
        args: argument dictionary
    """
    with open(fn) as data_file:
        data = json.load(data_file)

    args = {}

    args['patient_id'] = data['Patient ID']
    args['start_phase'] = data['Start Phase']
    args['total_phase'] = data['Total Phase']
    args['im_name'] = data["Image Name"]
    args['model_output']=data["Output Surface Model Name"]
    args['seg_name'] = data["Segmentation Name"]
    args['im_top_dir'] = data["Image Top Dir"]
    args['seg_folder_name'] = data["Segmentation Folder Name"]
    args['im_folder_name'] = data["Image Folder Name"]
    args['out_dir'] = data["Output Dir Name"]
    args['num_interpolation']=data["Number of Interpolations"]
    args['num_cycle'] = data["Number of Cardiac Cycles"]
    args['duration'] = data["Cycle Duration (s)"]
    args['edge_size'] = data["Mesh Size"]
    args['mask_folder_name'] = data["Mask Folder Name"]
    return args