import matplotlib.pyplot as plt import numpy as np import pandas as pd from master_funcs import * from collections import Counter from imblearn.over_sampling import SMOTE from imblearn.under_sampling import RandomUnderSampler from imblearn.pipeline import Pipeline import dill #%matplotlib qt import scipy import seaborn as sn import pingouin as pg import warnings import dataframe_image as dfi warnings.filterwarnings("ignore") ## Manual Rater Results Table # ============================================================================================================================================ mr_cyl_1=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_Cylinder_Analyse_Jan_figure.csv", index_col=0, delimiter=',', header=0) mr_cyl_2=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_Cylinder_Analyse_Nicole_figure.csv", index_col=0, delimiter=',', header=0) mr_cyl_3=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_Cylinder_Analyse_Jule_figure.csv", index_col=0, delimiter=',', header=0) mr_gw_1=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_GridWalk_Analyse_Jan_figure.csv", index_col=0, delimiter=',', header=0) mr_gw_2=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_GridWalk_Analyse_Nicole_figure.csv", index_col=0, delimiter=',', header=0) mr_gw_3=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_GridWalk_Analyse_Jule_figure.csv", index_col=0, delimiter=',', header=0) dfi.export(mr_cyl_1, '/home/user/owncloud/thesis_figures/MR_CY_1.png', max_cols=51) dfi.export(mr_cyl_2, '/home/user/owncloud/thesis_figures/MR_CY_2.png', max_cols=51) dfi.export(mr_cyl_3, '/home/user/owncloud/thesis_figures/MR_CY_3.png', max_cols=51) dfi.export(mr_gw_1, '/home/user/owncloud/thesis_figures/MR_GW_1.png') dfi.export(mr_gw_2, '/home/user/owncloud/thesis_figures/MR_GW_2.png') dfi.export(mr_gw_3, '/home/user/owncloud/thesis_figures/MR_GW_3.png') # ============================================================================================================================================ ## Correlation Feature Footfault within MR and between MR and DLC plus FI 2D and 3D # ============================================================================================================================================ mr_cyl_1=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_GridWalk_Analyse_Jan.csv", index_col=0, delimiter=',', header=None) mr_cyl_2=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_GridWalk_Analyse_Nicole.csv", index_col=0, delimiter=',', header=None) mr_cyl_3=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_GridWalk_Analyse_Jule.csv", index_col=0, delimiter=',', header=None) patients=['PB_T2_3_1', 'PB_T2_3_2', 'PB_T2_3_3', 'PB_T2_4_2', 'PB_T2_5_1', 'PB_T2_6_1', 'PB_T2_6_2', 'PB_T3_23_1', 'PB_T3_23_3', 'PB_T3_24_1', 'PB_T3_24_2', 'PB_T3_24_3'] max_i=np.array([np.nanmax(mr_cyl_1.loc['PB_T2_3_1']), np.nanmax(mr_cyl_2.loc['PB_T2_3_1']), np.nanmax(mr_cyl_3.loc['PB_T2_3_1']), np.nanmax(footfault_2d.loc['PB_T2_3_1']), np.nanmax(footfault_FI_2d.loc['PB_T2_3_1']), np.nanmax(footfault_3d.loc['PB_T2_3_1']), np.nanmax(footfault_FI_3d.loc['PB_T2_3_1'])]) mr_cyl_1_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_2_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_3_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) footfault_2d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) footfault_FI_2d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) footfault_3d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) footfault_FI_3d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) for i in mr_cyl_1.loc['PB_T2_3_1']: if i>0: mr_cyl_1_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_2.loc['PB_T2_3_1']: if i>0: mr_cyl_2_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_3.loc['PB_T2_3_1']: if i>0: mr_cyl_3_corr[int(i-15):int(i+16)]=1 for i in footfault_2d.loc['PB_T2_3_1']: if i>0: footfault_2d_corr[int(i-15):int(i+16)]=1 for i in footfault_FI_2d.loc['PB_T2_3_1']: if i>0: footfault_FI_2d_corr[int(i-15):int(i+16)]=1 for i in footfault_3d.loc['PB_T2_3_1']: if i>0: footfault_3d_corr[int(i-15):int(i+16)]=1 for i in footfault_FI_3d.loc['PB_T2_3_1']: if i>0: footfault_FI_3d_corr[int(i-15):int(i+16)]=1 for z in patients[1:]: max_i=np.array([np.nanmax(mr_cyl_1.loc[z]), np.nanmax(mr_cyl_2.loc[z]), np.nanmax(mr_cyl_3.loc[z]), np.nanmax(footfault_2d.loc[z]), np.nanmax(footfault_FI_2d.loc[z]), np.nanmax(footfault_3d.loc[z]), np.nanmax(footfault_FI_3d.loc[z])]) if all(max_i==max_i): mr_cyl_1_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_2_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_3_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) footfault_2d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) footfault_FI_2d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) footfault_3d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) footfault_FI_3d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) for i in mr_cyl_1.loc[z]: if i>0: mr_cyl_1_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_2.loc[z]: if i>0: mr_cyl_2_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_3.loc[z]: if i>0: mr_cyl_3_corr[int(i-15):int(i+16)]=1 for i in footfault_2d.loc[z]: if i>0: footfault_2d_corr[int(i-15):int(i+16)]=1 for i in footfault_FI_2d.loc[z]: if i>0: footfault_FI_2d_corr[int(i-15):int(i+16)]=1 for i in footfault_3d.loc[z]: if i>0: footfault_3d_corr[int(i-15):int(i+16)]=1 for i in footfault_FI_3d.loc[z]: if i>0: footfault_FI_3d_corr[int(i-15):int(i+16)]=1 mr_cyl_1_corr=np.r_[mr_cyl_1_corr, mr_cyl_1_corr_temp] mr_cyl_2_corr=np.r_[mr_cyl_2_corr, mr_cyl_2_corr_temp] mr_cyl_3_corr=np.r_[mr_cyl_3_corr, mr_cyl_3_corr_temp] footfault_2d_corr=np.r_[footfault_2d_corr, footfault_2d_corr_temp] footfault_FI_2d_corr=np.r_[footfault_FI_2d_corr, footfault_FI_2d_corr_temp] footfault_3d_corr=np.r_[footfault_3d_corr, footfault_3d_corr_temp] footfault_FI_3d_corr=np.r_[footfault_FI_3d_corr, footfault_FI_3d_corr_temp] sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_1_corr, mr_cyl_2_corr), jaccard(mr_cyl_1_corr, mr_cyl_3_corr)], [jaccard(mr_cyl_1_corr, mr_cyl_2_corr), 1, jaccard(mr_cyl_2_corr, mr_cyl_3_corr)], [jaccard(mr_cyl_1_corr, mr_cyl_3_corr), jaccard(mr_cyl_2_corr, mr_cyl_3_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(3, 3)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_MR_GW.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_1_corr, mr_cyl_2_corr), jaccard(mr_cyl_1_corr, mr_cyl_3_corr), jaccard(mr_cyl_1_corr, footfault_2d_corr)], [jaccard(mr_cyl_1_corr, mr_cyl_2_corr), 1, jaccard(mr_cyl_2_corr, mr_cyl_3_corr), jaccard(mr_cyl_2_corr, footfault_2d_corr)], [jaccard(mr_cyl_1_corr, mr_cyl_3_corr), jaccard(mr_cyl_2_corr, mr_cyl_3_corr), 1, jaccard(mr_cyl_3_corr, footfault_2d_corr)], [jaccard(mr_cyl_1_corr, footfault_2d_corr), jaccard(mr_cyl_2_corr, footfault_2d_corr), jaccard(mr_cyl_3_corr, footfault_2d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_GW_2d.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_1_corr, mr_cyl_2_corr), jaccard(mr_cyl_1_corr, mr_cyl_3_corr), jaccard(mr_cyl_1_corr, footfault_FI_2d_corr)], [jaccard(mr_cyl_1_corr, mr_cyl_2_corr), 1, jaccard(mr_cyl_2_corr, mr_cyl_3_corr), jaccard(mr_cyl_2_corr, footfault_FI_2d_corr)], [jaccard(mr_cyl_1_corr, mr_cyl_3_corr), jaccard(mr_cyl_2_corr, mr_cyl_3_corr), 1, jaccard(mr_cyl_3_corr, footfault_FI_2d_corr)], [jaccard(mr_cyl_1_corr, footfault_FI_2d_corr), jaccard(mr_cyl_2_corr, footfault_FI_2d_corr), jaccard(mr_cyl_3_corr, footfault_FI_2d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_GW_FI_2d.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_1_corr, mr_cyl_2_corr), jaccard(mr_cyl_1_corr, mr_cyl_3_corr), jaccard(mr_cyl_1_corr, footfault_3d_corr)], [jaccard(mr_cyl_1_corr, mr_cyl_2_corr), 1, jaccard(mr_cyl_2_corr, mr_cyl_3_corr), jaccard(mr_cyl_2_corr, footfault_3d_corr)], [jaccard(mr_cyl_1_corr, mr_cyl_3_corr), jaccard(mr_cyl_2_corr, mr_cyl_3_corr), 1, jaccard(mr_cyl_3_corr, footfault_3d_corr)], [jaccard(mr_cyl_1_corr, footfault_3d_corr), jaccard(mr_cyl_2_corr, footfault_3d_corr), jaccard(mr_cyl_3_corr, footfault_3d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_GW_3d.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_1_corr, mr_cyl_2_corr), jaccard(mr_cyl_1_corr, mr_cyl_3_corr), jaccard(mr_cyl_1_corr, footfault_FI_3d_corr)], [jaccard(mr_cyl_1_corr, mr_cyl_2_corr), 1, jaccard(mr_cyl_2_corr, mr_cyl_3_corr), jaccard(mr_cyl_2_corr, footfault_FI_3d_corr)], [jaccard(mr_cyl_1_corr, mr_cyl_3_corr), jaccard(mr_cyl_2_corr, mr_cyl_3_corr), 1, jaccard(mr_cyl_3_corr, footfault_FI_3d_corr)], [jaccard(mr_cyl_1_corr, footfault_FI_3d_corr), jaccard(mr_cyl_2_corr, footfault_FI_3d_corr), jaccard(mr_cyl_3_corr, footfault_FI_3d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_GW_FI_3d.png", format='png', dpi=200) print('GW 3D') df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_1_corr))]+[i for i in range(len(mr_cyl_2_corr))]+[i for i in range(len(mr_cyl_3_corr))], 'rater':['1']*len(mr_cyl_1_corr)+['2']*len(mr_cyl_2_corr)+['3']*len(mr_cyl_3_corr), 'rating':np.concatenate((mr_cyl_1_corr, mr_cyl_2_corr, mr_cyl_3_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_1_corr))]+[i for i in range(len(mr_cyl_2_corr))]+[i for i in range(len(mr_cyl_3_corr))]+[i for i in range(len(footfault_2d_corr))], 'rater':['1']*len(mr_cyl_1_corr)+['2']*len(mr_cyl_2_corr)+['3']*len(mr_cyl_3_corr)+['DLC']*len(footfault_2d_corr), 'rating':np.concatenate((mr_cyl_1_corr, mr_cyl_2_corr, mr_cyl_3_corr, footfault_2d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_1_corr))]+[i for i in range(len(mr_cyl_2_corr))]+[i for i in range(len(mr_cyl_3_corr))]+[i for i in range(len(footfault_FI_2d_corr))], 'rater':['1']*len(mr_cyl_1_corr)+['2']*len(mr_cyl_2_corr)+['3']*len(mr_cyl_3_corr)+['DLC']*len(footfault_FI_2d_corr), 'rating':np.concatenate((mr_cyl_1_corr, mr_cyl_2_corr, mr_cyl_3_corr, footfault_FI_2d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_1_corr))]+[i for i in range(len(mr_cyl_2_corr))]+[i for i in range(len(mr_cyl_3_corr))]+[i for i in range(len(footfault_3d_corr))], 'rater':['1']*len(mr_cyl_1_corr)+['2']*len(mr_cyl_2_corr)+['3']*len(mr_cyl_3_corr)+['DLC']*len(footfault_3d_corr), 'rating':np.concatenate((mr_cyl_1_corr, mr_cyl_2_corr, mr_cyl_3_corr, footfault_3d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_1_corr))]+[i for i in range(len(mr_cyl_2_corr))]+[i for i in range(len(mr_cyl_3_corr))]+[i for i in range(len(footfault_FI_3d_corr))], 'rater':['1']*len(mr_cyl_1_corr)+['2']*len(mr_cyl_2_corr)+['3']*len(mr_cyl_3_corr)+['DLC']*len(footfault_FI_3d_corr), 'rating':np.concatenate((mr_cyl_1_corr, mr_cyl_2_corr, mr_cyl_3_corr, footfault_FI_3d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) # ============================================================================================================================================ ## Correlation Feature Cylinder Touch within MR and between MR and DLC plus FI 2D and 3D # ============================================================================================================================================ mr_cyl_touch_1=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_Cylinder_Analyse_Jan_touch.csv", index_col=0, delimiter=',', header=None) mr_cyl_touch_2=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_Cylinder_Analyse_Nicole_touch.csv", index_col=0, delimiter=',', header=None) mr_cyl_touch_3=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_Cylinder_Analyse_Jule_touch.csv", index_col=0, delimiter=',', header=None) patients=['PB_T2_3_1', 'PB_T2_3_2', 'PB_T2_3_3', 'PB_T2_4_2', 'PB_T2_5_1', 'PB_T2_6_1', 'PB_T2_6_2', 'PB_T3_23_1', 'PB_T3_23_2', 'PB_T3_23_3', 'PB_T3_24_1', 'PB_T3_24_2', 'PB_T3_24_3'] max_i=np.array([np.nanmax(mr_cyl_touch_1.loc['PB_T2_3_1']), np.nanmax(mr_cyl_touch_2.loc['PB_T2_3_1']), np.nanmax(mr_cyl_touch_3.loc['PB_T2_3_1']), np.nanmax(touch_2d.loc['PB_T2_3_1']), np.nanmax(touch_FI_2d.loc['PB_T2_3_1']), np.nanmax(touch_3d.loc['PB_T2_3_1']), np.nanmax(touch_FI_3d.loc['PB_T2_3_1'])]) mr_cyl_touch_1_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_touch_2_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_touch_3_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) touch_2d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) touch_FI_2d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) touch_3d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) touch_FI_3d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) for i in mr_cyl_touch_1.loc['PB_T2_3_1']: if i>0: mr_cyl_touch_1_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_touch_2.loc['PB_T2_3_1']: if i>0: mr_cyl_touch_2_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_touch_3.loc['PB_T2_3_1']: if i>0: mr_cyl_touch_3_corr[int(i-15):int(i+16)]=1 for i in touch_2d.loc['PB_T2_3_1']: if i>0: touch_2d_corr[int(i-15):int(i+16)]=1 for i in touch_FI_2d.loc['PB_T2_3_1']: if i>0: touch_FI_2d_corr[int(i-15):int(i+16)]=1 for i in touch_3d.loc['PB_T2_3_1']: if i>0: touch_3d_corr[int(i-15):int(i+16)]=1 for i in touch_FI_3d.loc['PB_T2_3_1']: if i>0: touch_FI_3d_corr[int(i-15):int(i+16)]=1 for z in patients[1:]: max_i=np.array([np.nanmax(mr_cyl_touch_1.loc[z]), np.nanmax(mr_cyl_touch_2.loc[z]), np.nanmax(mr_cyl_touch_3.loc[z]), np.nanmax(touch_2d.loc[z]), np.nanmax(touch_FI_2d.loc[z]), np.nanmax(touch_3d.loc[z]), np.nanmax(touch_FI_3d.loc[z])]) if all(max_i==max_i): mr_cyl_touch_1_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_touch_2_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_touch_3_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) touch_2d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) touch_FI_2d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) touch_3d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) touch_FI_3d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) for i in mr_cyl_touch_1.loc[z]: if i>0: mr_cyl_touch_1_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_touch_2.loc[z]: if i>0: mr_cyl_touch_2_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_touch_3.loc[z]: if i>0: mr_cyl_touch_3_corr[int(i-15):int(i+16)]=1 for i in touch_2d.loc[z]: if i>0: touch_2d_corr[int(i-15):int(i+16)]=1 for i in touch_FI_2d.loc[z]: if i>0: touch_FI_2d_corr[int(i-15):int(i+16)]=1 for i in touch_3d.loc[z]: if i>0: touch_3d_corr[int(i-15):int(i+16)]=1 for i in touch_FI_3d.loc[z]: if i>0: touch_FI_3d_corr[int(i-15):int(i+16)]=1 mr_cyl_touch_1_corr=np.r_[mr_cyl_touch_1_corr, mr_cyl_touch_1_corr_temp] mr_cyl_touch_2_corr=np.r_[mr_cyl_touch_2_corr, mr_cyl_touch_2_corr_temp] mr_cyl_touch_3_corr=np.r_[mr_cyl_touch_3_corr, mr_cyl_touch_3_corr_temp] touch_2d_corr=np.r_[touch_2d_corr, touch_2d_corr_temp] touch_FI_2d_corr=np.r_[touch_FI_2d_corr, touch_FI_2d_corr_temp] touch_3d_corr=np.r_[touch_3d_corr, touch_3d_corr_temp] touch_FI_3d_corr=np.r_[touch_FI_3d_corr, touch_FI_3d_corr_temp] sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_2_corr), jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_3_corr)], [jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_2_corr), 1, jaccard(mr_cyl_touch_2_corr, mr_cyl_touch_3_corr)], [jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_2_corr, mr_cyl_touch_3_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(3, 3)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_MR_CY_touch.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_2_corr), jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_1_corr, touch_2d_corr)], [jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_2_corr), 1, jaccard(mr_cyl_touch_2_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_2_corr, touch_2d_corr)], [jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_2_corr, mr_cyl_touch_3_corr), 1, jaccard(mr_cyl_touch_3_corr, touch_2d_corr)], [jaccard(mr_cyl_touch_1_corr, touch_2d_corr), jaccard(mr_cyl_touch_2_corr, touch_2d_corr), jaccard(mr_cyl_touch_3_corr, touch_2d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_CY_touch_2d.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_2_corr), jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_1_corr, touch_FI_2d_corr)], [jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_2_corr), 1, jaccard(mr_cyl_touch_2_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_2_corr, touch_FI_2d_corr)], [jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_2_corr, mr_cyl_touch_3_corr), 1, jaccard(mr_cyl_touch_3_corr, touch_FI_2d_corr)], [jaccard(mr_cyl_touch_1_corr, touch_FI_2d_corr), jaccard(mr_cyl_touch_2_corr, touch_FI_2d_corr), jaccard(mr_cyl_touch_3_corr, touch_FI_2d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_CY_touch_FI_2d.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_2_corr), jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_1_corr, touch_3d_corr)], [jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_2_corr), 1, jaccard(mr_cyl_touch_2_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_2_corr, touch_3d_corr)], [jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_2_corr, mr_cyl_touch_3_corr), 1, jaccard(mr_cyl_touch_3_corr, touch_3d_corr)], [jaccard(mr_cyl_touch_1_corr, touch_3d_corr), jaccard(mr_cyl_touch_2_corr, touch_3d_corr), jaccard(mr_cyl_touch_3_corr, touch_3d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_CY_touch_3d.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_2_corr), jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_1_corr, touch_FI_3d_corr)], [jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_2_corr), 1, jaccard(mr_cyl_touch_2_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_2_corr, touch_FI_3d_corr)], [jaccard(mr_cyl_touch_1_corr, mr_cyl_touch_3_corr), jaccard(mr_cyl_touch_2_corr, mr_cyl_touch_3_corr), 1, jaccard(mr_cyl_touch_3_corr, touch_FI_3d_corr)], [jaccard(mr_cyl_touch_1_corr, touch_FI_3d_corr), jaccard(mr_cyl_touch_2_corr, touch_FI_3d_corr), jaccard(mr_cyl_touch_3_corr, touch_FI_3d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_CY_touch_FI_3d.png", format='png', dpi=200) print('CY touch 3D') df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_touch_1_corr))]+[i for i in range(len(mr_cyl_touch_2_corr))]+[i for i in range(len(mr_cyl_touch_3_corr))], 'rater':['1']*len(mr_cyl_touch_1_corr)+['2']*len(mr_cyl_touch_2_corr)+['3']*len(mr_cyl_touch_3_corr), 'rating':np.concatenate((mr_cyl_touch_1_corr, mr_cyl_touch_2_corr, mr_cyl_touch_3_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_touch_1_corr))]+[i for i in range(len(mr_cyl_touch_2_corr))]+[i for i in range(len(mr_cyl_touch_3_corr))]+[i for i in range(len(touch_2d_corr))], 'rater':['1']*len(mr_cyl_touch_1_corr)+['2']*len(mr_cyl_touch_2_corr)+['3']*len(mr_cyl_touch_3_corr)+['DLC']*len(touch_2d_corr), 'rating':np.concatenate((mr_cyl_touch_1_corr, mr_cyl_touch_2_corr, mr_cyl_touch_3_corr, touch_2d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_touch_1_corr))]+[i for i in range(len(mr_cyl_touch_2_corr))]+[i for i in range(len(mr_cyl_touch_3_corr))]+[i for i in range(len(touch_FI_2d_corr))], 'rater':['1']*len(mr_cyl_touch_1_corr)+['2']*len(mr_cyl_touch_2_corr)+['3']*len(mr_cyl_touch_3_corr)+['DLC']*len(touch_FI_2d_corr), 'rating':np.concatenate((mr_cyl_touch_1_corr, mr_cyl_touch_2_corr, mr_cyl_touch_3_corr, touch_FI_2d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_touch_1_corr))]+[i for i in range(len(mr_cyl_touch_2_corr))]+[i for i in range(len(mr_cyl_touch_3_corr))]+[i for i in range(len(touch_3d_corr))], 'rater':['1']*len(mr_cyl_touch_1_corr)+['2']*len(mr_cyl_touch_2_corr)+['3']*len(mr_cyl_touch_3_corr)+['DLC']*len(touch_3d_corr), 'rating':np.concatenate((mr_cyl_touch_1_corr, mr_cyl_touch_2_corr, mr_cyl_touch_3_corr, touch_3d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_touch_1_corr))]+[i for i in range(len(mr_cyl_touch_2_corr))]+[i for i in range(len(mr_cyl_touch_3_corr))]+[i for i in range(len(touch_FI_3d_corr))], 'rater':['1']*len(mr_cyl_touch_1_corr)+['2']*len(mr_cyl_touch_2_corr)+['3']*len(mr_cyl_touch_3_corr)+['DLC']*len(touch_FI_3d_corr), 'rating':np.concatenate((mr_cyl_touch_1_corr, mr_cyl_touch_2_corr, mr_cyl_touch_3_corr, touch_FI_3d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) # ============================================================================================================================================ ## Correlation Feature Cylinder Drag within MR and between MR and DLC plus FI 2D and 3D # ============================================================================================================================================ mr_cyl_drag_1=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_Cylinder_Analyse_Jan_drag.csv", index_col=0, delimiter=',', header=None) mr_cyl_drag_2=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_Cylinder_Analyse_Nicole_drag.csv", index_col=0, delimiter=',', header=None) mr_cyl_drag_3=pd.read_csv("/home/user/owncloud/3D_videos/manual_raters/Manual_Cylinder_Analyse_Jule_drag.csv", index_col=0, delimiter=',', header=None) patients=['PB_T2_3_1', 'PB_T2_3_2', 'PB_T2_3_3', 'PB_T2_4_2', 'PB_T2_5_1', 'PB_T2_6_1', 'PB_T2_6_2', 'PB_T3_23_1', 'PB_T3_23_2', 'PB_T3_23_3', 'PB_T3_24_1', 'PB_T3_24_2', 'PB_T3_24_3'] max_i=np.array([np.nanmax(mr_cyl_drag_1.loc['PB_T2_3_1']), np.nanmax(mr_cyl_drag_2.loc['PB_T2_3_1']), np.nanmax(mr_cyl_drag_3.loc['PB_T2_3_1']), np.nanmax(drag_2d.loc['PB_T2_3_1']), np.nanmax(drag_FI_2d.loc['PB_T2_3_1']), np.nanmax(drag_3d.loc['PB_T2_3_1']), np.nanmax(drag_FI_3d.loc['PB_T2_3_1'])]) mr_cyl_drag_1_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_drag_2_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_drag_3_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) drag_2d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) drag_FI_2d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) drag_3d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) drag_FI_3d_corr=np.zeros(shape=(int(np.nanmax(max_i)+11),)) for i in mr_cyl_drag_1.loc['PB_T2_3_1']: if i>0: mr_cyl_drag_1_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_drag_2.loc['PB_T2_3_1']: if i>0: mr_cyl_drag_2_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_drag_3.loc['PB_T2_3_1']: if i>0: mr_cyl_drag_3_corr[int(i-15):int(i+16)]=1 for i in drag_2d.loc['PB_T2_3_1']: if i>0: drag_2d_corr[int(i-15):int(i+16)]=1 for i in drag_FI_2d.loc['PB_T2_3_1']: if i>0: drag_FI_2d_corr[int(i-15):int(i+16)]=1 for i in drag_3d.loc['PB_T2_3_1']: if i>0: drag_3d_corr[int(i-15):int(i+16)]=1 for i in drag_FI_3d.loc['PB_T2_3_1']: if i>0: drag_FI_3d_corr[int(i-15):int(i+16)]=1 for z in patients[1:]: max_i=np.array([np.nanmax(mr_cyl_drag_1.loc[z]), np.nanmax(mr_cyl_drag_2.loc[z]), np.nanmax(mr_cyl_drag_3.loc[z]), np.nanmax(drag_2d.loc[z]), np.nanmax(drag_FI_2d.loc[z]), np.nanmax(drag_3d.loc[z]), np.nanmax(drag_FI_3d.loc[z])]) if all(max_i==max_i): mr_cyl_drag_1_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_drag_2_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) mr_cyl_drag_3_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) drag_2d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) drag_FI_2d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) drag_3d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) drag_FI_3d_corr_temp=np.zeros(shape=(int(np.nanmax(max_i)+11),)) for i in mr_cyl_drag_1.loc[z]: if i>0: mr_cyl_drag_1_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_drag_2.loc[z]: if i>0: mr_cyl_drag_2_corr[int(i-15):int(i+16)]=1 for i in mr_cyl_drag_3.loc[z]: if i>0: mr_cyl_drag_3_corr[int(i-15):int(i+16)]=1 for i in drag_2d.loc[z]: if i>0: drag_2d_corr[int(i-15):int(i+16)]=1 for i in drag_FI_2d.loc[z]: if i>0: drag_FI_2d_corr[int(i-15):int(i+16)]=1 for i in drag_3d.loc[z]: if i>0: drag_3d_corr[int(i-15):int(i+16)]=1 for i in drag_FI_3d.loc[z]: if i>0: drag_FI_3d_corr[int(i-15):int(i+16)]=1 mr_cyl_drag_1_corr=np.r_[mr_cyl_drag_1_corr, mr_cyl_drag_1_corr_temp] mr_cyl_drag_2_corr=np.r_[mr_cyl_drag_2_corr, mr_cyl_drag_2_corr_temp] mr_cyl_drag_3_corr=np.r_[mr_cyl_drag_3_corr, mr_cyl_drag_3_corr_temp] drag_2d_corr=np.r_[drag_2d_corr, drag_2d_corr_temp] drag_FI_2d_corr=np.r_[drag_FI_2d_corr, drag_FI_2d_corr_temp] drag_3d_corr=np.r_[drag_3d_corr, drag_3d_corr_temp] drag_FI_3d_corr=np.r_[drag_FI_3d_corr, drag_FI_3d_corr_temp] sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_2_corr), jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_3_corr)], [jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_2_corr), 1, jaccard(mr_cyl_drag_2_corr, mr_cyl_drag_3_corr)], [jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_2_corr, mr_cyl_drag_3_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(3, 3)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_MR_CY_drag.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_2_corr), jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_1_corr, drag_2d_corr)], [jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_2_corr), 1, jaccard(mr_cyl_drag_2_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_2_corr, drag_2d_corr)], [jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_2_corr, mr_cyl_drag_3_corr), 1, jaccard(mr_cyl_drag_3_corr, drag_2d_corr)], [jaccard(mr_cyl_drag_1_corr, drag_2d_corr), jaccard(mr_cyl_drag_2_corr, drag_2d_corr), jaccard(mr_cyl_drag_3_corr, drag_2d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_CY_drag_2d.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_2_corr), jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_1_corr, drag_FI_2d_corr)], [jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_2_corr), 1, jaccard(mr_cyl_drag_2_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_2_corr, drag_FI_2d_corr)], [jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_2_corr, mr_cyl_drag_3_corr), 1, jaccard(mr_cyl_drag_3_corr, drag_FI_2d_corr)], [jaccard(mr_cyl_drag_1_corr, drag_FI_2d_corr), jaccard(mr_cyl_drag_2_corr, drag_FI_2d_corr), jaccard(mr_cyl_drag_3_corr, drag_FI_2d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_CY_drag_FI_2d.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_2_corr), jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_1_corr, drag_3d_corr)], [jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_2_corr), 1, jaccard(mr_cyl_drag_2_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_2_corr, drag_3d_corr)], [jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_2_corr, mr_cyl_drag_3_corr), 1, jaccard(mr_cyl_drag_3_corr, drag_3d_corr)], [jaccard(mr_cyl_drag_1_corr, drag_3d_corr), jaccard(mr_cyl_drag_2_corr, drag_3d_corr), jaccard(mr_cyl_drag_3_corr, drag_3d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_CY_drag_3d.png", format='png', dpi=200) sn.set_theme(style="white") d = pd.DataFrame(data=np.array([[1,jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_2_corr), jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_1_corr, drag_FI_3d_corr)], [jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_2_corr), 1, jaccard(mr_cyl_drag_2_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_2_corr, drag_FI_3d_corr)], [jaccard(mr_cyl_drag_1_corr, mr_cyl_drag_3_corr), jaccard(mr_cyl_drag_2_corr, mr_cyl_drag_3_corr), 1, jaccard(mr_cyl_drag_3_corr, drag_FI_3d_corr)], [jaccard(mr_cyl_drag_1_corr, drag_FI_3d_corr), jaccard(mr_cyl_drag_2_corr, drag_FI_3d_corr), jaccard(mr_cyl_drag_3_corr, drag_FI_3d_corr), 1]]) , columns=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC'], index=['Manual Rater 1', 'Manual Rater 2', 'Manual Rater 3', 'DLC']) mask = np.tril(np.ones_like(d, dtype=bool), k=-1) f, ax = plt.subplots(figsize=(4, 4)) cmap = sn.diverging_palette(10, 250, s=90, l=40, as_cmap=True) sn.set(font_scale=3) hmap=sn.heatmap(d, mask=mask.T, cmap=cmap, vmax=1, vmin=0, center=0, annot=True, square=True, linewidths=1, cbar_kws={"shrink": .6}, fmt=".3g") hmap.set_xticklabels(hmap.get_xmajorticklabels(), fontsize = 40, rotation=45) hmap.set_yticklabels(hmap.get_ymajorticklabels(), fontsize = 40) hmap.figure.set_size_inches(22, 18) plt.tight_layout() hmap.figure.savefig("/home/user/owncloud/thesis_figures/Correlation_DLC_CY_drag_FI_3d.png", format='png', dpi=200) print('CY drag 3D') df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_drag_1_corr))]+[i for i in range(len(mr_cyl_drag_2_corr))]+[i for i in range(len(mr_cyl_drag_3_corr))], 'rater':['1']*len(mr_cyl_drag_1_corr)+['2']*len(mr_cyl_drag_2_corr)+['3']*len(mr_cyl_drag_3_corr), 'rating':np.concatenate((mr_cyl_drag_1_corr, mr_cyl_drag_2_corr, mr_cyl_drag_3_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_drag_1_corr))]+[i for i in range(len(mr_cyl_drag_2_corr))]+[i for i in range(len(mr_cyl_drag_3_corr))]+[i for i in range(len(drag_2d_corr))], 'rater':['1']*len(mr_cyl_drag_1_corr)+['2']*len(mr_cyl_drag_2_corr)+['3']*len(mr_cyl_drag_3_corr)+['DLC']*len(drag_2d_corr), 'rating':np.concatenate((mr_cyl_drag_1_corr, mr_cyl_drag_2_corr, mr_cyl_drag_3_corr, drag_2d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_drag_1_corr))]+[i for i in range(len(mr_cyl_drag_2_corr))]+[i for i in range(len(mr_cyl_drag_3_corr))]+[i for i in range(len(drag_FI_2d_corr))], 'rater':['1']*len(mr_cyl_drag_1_corr)+['2']*len(mr_cyl_drag_2_corr)+['3']*len(mr_cyl_drag_3_corr)+['DLC']*len(drag_FI_2d_corr), 'rating':np.concatenate((mr_cyl_drag_1_corr, mr_cyl_drag_2_corr, mr_cyl_drag_3_corr, drag_FI_2d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_drag_1_corr))]+[i for i in range(len(mr_cyl_drag_2_corr))]+[i for i in range(len(mr_cyl_drag_3_corr))]+[i for i in range(len(drag_3d_corr))], 'rater':['1']*len(mr_cyl_drag_1_corr)+['2']*len(mr_cyl_drag_2_corr)+['3']*len(mr_cyl_drag_3_corr)+['DLC']*len(drag_3d_corr), 'rating':np.concatenate((mr_cyl_drag_1_corr, mr_cyl_drag_2_corr, mr_cyl_drag_3_corr, drag_3d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) df=pd.DataFrame({'index':[i for i in range(len(mr_cyl_drag_1_corr))]+[i for i in range(len(mr_cyl_drag_2_corr))]+[i for i in range(len(mr_cyl_drag_3_corr))]+[i for i in range(len(drag_FI_3d_corr))], 'rater':['1']*len(mr_cyl_drag_1_corr)+['2']*len(mr_cyl_drag_2_corr)+['3']*len(mr_cyl_drag_3_corr)+['DLC']*len(drag_FI_3d_corr), 'rating':np.concatenate((mr_cyl_drag_1_corr, mr_cyl_drag_2_corr, mr_cyl_drag_3_corr, drag_FI_3d_corr))}) icc = pg.intraclass_corr(data=df, targets='index', raters='rater', ratings='rating', nan_policy='omit') print(icc.loc[2]) # ============================================================================================================================================