def liver_dump(liver, ep=None):
    liver_save = {}
    liver_save['vtx'] = liver['vtx'].tolist()
    liver_save['x'] = np.array(liver['x']).tolist()
    liver_save['Fes'] = np.array(liver['Fes']).tolist()
    liver_save['Fis'] = np.array(liver['Fis']).tolist()
    liver_save['Ficp'] = np.array(liver['Ficp']).tolist()
    liver_save['volume'] = np.array(liver['volume']).tolist()
    liver_save['col_p_n'] = np.array(liver['col_p_n']).tolist()
    liver_save['crash'] = np.array(liver['crash']).tolist()
    if (ep is None):
        with open(os.path.join('liver_json', f"liver_record{liver['name']}.json"), 'w') as f:
            json.dump(liver_save, f)
    else:
        with open(os.path.join('liver_json', f'liver_record_{int(ep)}.json'), 'w') as f:
            json.dump(liver_save, f)
def liver_dump(liver, ep=None):
    liver_save = {}
    liver_save['vtx'] = liver['vtx'].tolist()
    liver_save['x'] = np.array(liver['x']).tolist()
    liver_save['Fes'] = np.array(liver['Fes']).tolist()
    liver_save['Fis'] = np.array(liver['Fis']).tolist()
    liver_save['Ficp'] = np.array(liver['Ficp']).tolist()
    liver_save['volume'] = np.array(liver['volume']).tolist()
    liver_save['col_p_n'] = np.array(liver['col_p_n']).tolist()
    liver_save['crash'] = np.array(liver['crash']).tolist()
    if (ep is None):
        with open(os.path.join('liver_json', f"liver_record{liver['name']}.json"), 'w') as f:
            json.dump(liver_save, f)
    else:
        with open(os.path.join('liver_json', f'liver_record_{int(ep)}.json'), 'w') as f:
            json.dump(liver_save, f)