import numpy as np

AttU = [0.7330632446402159, 0.719419077461662, 0.7053246197347041, 0.6497455859038883, 0.6897044308917739,
        0.6532580610571249, 0.6613046491873045, 0.6425747938835861, 0.6466111218954645, 0.6675740028952228,
        0.7468173933158537, 0.6904286846222843, 0.6676193360955576, 0.6463106866016385, 0.6520932308545588,
        0.6861632678701548, 0.6400256775984365, 0.6580166445231685, 0.6512634511442669, 0.6519593141585045,
        0.6849447400363229, 0.6233909913581612, 0.6633394328327811, 0.596266033556508, 0.6668126724838053,
        0.6855924007135419, 0.6457427252627568, 0.6550356924230307, 0.63945153608184, 0.6876045032297201,
        0.6574160832736761, 0.6645282851207417, 0.6498161681119881, 0.6770572277188849, 0.6489990443873264]

# (0.8062674386160714, 0.6418300581624597)


U_net = [0.6773289638033635, 0.7208466415550441, 0.6998060739329657, 0.6999030336984029, 0.7326601022854792,
         0.6176544950824436, 0.6439105735537648, 0.6567016717148322, 0.6911670605231286, 0.7006469532646926,
         0.7679496429563317, 0.6423829305556823, 0.6571388878464206, 0.6766246083291739, 0.6783989615670897,
         0.7296363565197996, 0.6821961978315183, 0.6521735276822731, 0.6655250188973182, 0.6845970115811584,
         0.7026104437118272, 0.6341542798208454, 0.6788537410189639, 0.6558139657960373, 0.7009461535217358,
         0.7200103041263106, 0.664928093367082, 0.690969938393637, 0.6693997644615933, 0.7256590925666827,
         0.699644713911909, 0.7345613757480316, 0.6853418328816836, 0.6999173086114783, 0.6848435467344838]

# (0.8154139927455357, 0.6864287804563723)


MDOAU_net = [0.6930914788845772, 0.6874904005362383, 0.698299139352976, 0.6868838280953111, 0.7257522940744174,
             0.6182672735234405, 0.6706961433483998, 0.6374398135572095, 0.6844694199885992, 0.6973580420630302,
             0.7688237159435845, 0.5925127712380049, 0.6079156026270122, 0.6457284423605324, 0.665794883093377,
             0.7163901564760031, 0.6745874187794949, 0.6333258145582648, 0.6337236992848623, 0.6754387722472615,
             0.6964508686515989, 0.6455057001101213, 0.6788919215000204, 0.6461883939706393, 0.6965502837431004,
             0.6933094254459513, 0.671278139340904, 0.6771272537078432, 0.6710986742875288, 0.7322374844595171,
             0.6963126547330227, 0.7310921851054135, 0.7040960144209818, 0.7238503197381351, 0.7146934590408391]
MDOAU2_net_2 = [0.7279314018758618, 0.7573502995068128, 0.7200477680628511, 0.7077297391274018, 0.7460500767736667,
                0.6875104659559947, 0.6822218936644452, 0.6789024076092158, 0.6877805812412815, 0.7032183652668749,
                0.7779982515361321, 0.707955793623328, 0.6890856631597242, 0.6942311706397889, 0.7016140834897855,
                0.7614019486492929, 0.7042313533743116, 0.6979078107452259, 0.6915162174522047, 0.6935671940070252,
                0.7289369372575158, 0.6347360988387238, 0.6991869689047856, 0.7151120276937005, 0.7304744479515084,
                0.7576156345180771, 0.679415454350708, 0.701800161746181, 0.680895062600684, 0.7638904431050773,
                0.7379415792044439, 0.7576788971404549, 0.7292301711114493, 0.7438975141033652, 0.7290344550256929]

Seg_net = [0.7196524463781737, 0.7069912966511764, 0.6630073171825965, 0.6396363330292438, 0.6689057910498528,
           0.6246754572115545, 0.610219500140087, 0.5609153977960163, 0.5698003616073374, 0.5953267475005704,
           0.7051127782411397, 0.6519373574600955, 0.5641982753332007, 0.516813021132053, 0.5316809273616757,
           0.6348335440466392, 0.593439415509886, 0.5019233859963705, 0.5095763149628336, 0.4983164576974195,
           0.538629112848873, 0.5418722833200953, 0.5585360189701878, 0.49750550526923265, 0.45858086488515326,
           0.41748422790724354, 0.5480466525106423, 0.4981222755407104, 0.5686630639518201, 0.5760432792995593,
           0.530621360284871, 0.615341957677091, 0.6063577554019258, 0.5783723921636641, 0.6244321245216149]

NestedUNet = [0.5728648920400448, 0.759317922556443, 0.7358593143755406, 0.7288271108447585, 0.7474354630870104,
              0.683949949909416, 0.6999053847266068, 0.6915522075862752, 0.7042470725400749, 0.7016413212776844,
              0.7419672818865257, 0.7116144046467088, 0.6951764307753042, 0.7001472460152921, 0.6799402176280619,
              0.7130335924261052, 0.6853863880394264, 0.6956335858309253, 0.6739363238036334, 0.6869734524103506,
              0.717027166313291, 0.6537809304240843, 0.7029652377837066, 0.628071849060063, 0.6718826893161645,
              0.7063393132398541, 0.6822335468282344, 0.7033639055896966, 0.6802503119697287, 0.6714983246429788,
              0.6654514119287707, 0.674872917396813, 0.6486275199345602, 0.6898637967502252, 0.6684430242756096]

MDOAU2_net_2_mean, MDOAU2_net_2_std, MDOAU2_net_2_var = np.mean(MDOAU2_net_2), np.std(MDOAU2_net_2), np.var(MDOAU2_net_2)

data, method_name = [AttU, U_net, Seg_net, NestedUNet, MDOAU_net], ['AttU', 'U_net', 'Seg_net', 'NestedUNet', 'MDOAU_net']

print("sample number:")
for i in range(len(data)):
    print(method_name[i], len(data[i]))
print("MDOAU_net", len(MDOAU_net))

for i in range(len(data)):
    mid_method_data, mid_name = np.array(data[i]), method_name[i]
    mid_mean, mid_std, mid_var = np.mean(mid_method_data), np.std(mid_method_data), np.var(mid_method_data)
    mid_z_score = (MDOAU2_net_2_mean - mid_mean) / np.sqrt(mid_var / len(data[i]) + MDOAU2_net_2_var / len(data[i]))
    print(mid_name, mid_z_score, mid_z_score > 2.58)
    print(MDOAU2_net_2_mean, mid_mean, MDOAU2_net_2_std, mid_std, len(data[i]))
