Skip to content

Commit

Permalink
Edit centiles
Browse files Browse the repository at this point in the history
  • Loading branch information
MUSA-650 committed May 25, 2024
1 parent f41c1c1 commit 2ffdc45
Show file tree
Hide file tree
Showing 14 changed files with 25,365 additions and 25,264 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
.*
__pycache__
NiChart_Viewer/tmp*
tmp*
test*
tmp/
test/
!.gitignore
6 changes: 4 additions & 2 deletions NiChart_Viewer/plugins/centileview/centileview.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ def OnCentileTypeChanged(self):
self.selCentileFile = dict_centile[self.selCentileType]

## FIXME
d = '/home/guray/Github/NiChart_Projects/NiChart_Viewer/'
fCentile = os.path.join(self.root_dir, 'shared', 'centiles', 'NiChartcentiles',
self.selCentileFile + '.csv')

dio = DataIO()
self.df_cent = dio.ReadCSVFile(fCentile)


self.statusbar.showMessage('Centile reference changed to: ' + self.selCentileType, 8000)
#self.statusbar.showMessage('Centile reference changed to: ' + self.selCentileType, 8000)
self.statusbar.showMessage('Centile file: ' + fCentile, 8000)

def OnPlotBtnClicked(self):

Expand All @@ -130,6 +130,8 @@ def OnPlotBtnClicked(self):

df_out = df

self.statusbar.showMessage('Centile cols : ' + ','.join(self.df_cent.ROI_Name.unique()), 8000)

#DataPlotScatter(self.plotCanvas.axes, df_out, x_var, y_var)
DataPlotWithCentiles(self.plotCanvas.axes, df_out, x_var, y_var, self.df_cent, self.selCentileType)

Expand Down
70 changes: 70 additions & 0 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/List_Map_Tmp.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
ROI1,ROI2
"M0_amygdala_L","Amygdala_L"
"M0_amygdala_L_PercICV","Amygdala_L_PercICV"
"M0_amygdala_R","Amygdala_R"
"M0_amygdala_R_PercICV","Amygdala_R_PercICV"
"M0_caudate_L","Caudate_L"
"M0_caudate_L_PercICV","Caudate_L_PercICV"
"M0_caudate_R","Caudate_R"
"M0_caudate_R_PercICV","Caudate_R_PercICV"
"M0_corpus_callosum","CorpusCallosum"
"M0_corpus_callosum_PercICV","CorpusCallosum_PercICV"
"M0_hippocampus_L","Hippocampus_L"
"M0_hippocampus_L_PercICV","Hippocampus_L_PercICV"
"M0_hippocampus_R","Hippocampus_R"
"M0_hippocampus_R_PercICV","Hippocampus_R_PercICV"
"M0_Lateral_ventricle_L","LateralVentricles_L"
"M0_Lateral_ventricle_L_PercICV","LateralVentricles_L_PercICV"
"M0_Lateral_ventricle_R","LateralVentricles_R"
"M0_Lateral_ventricle_R_PercICV","LateralVentricles_R_PercICV"
"M0_putamen_L","Putamen_L"
"M0_putamen_L_PercICV","Putamen_L_PercICV"
"M0_putamen_R","Putamen_R"
"M0_putamen_R_PercICV","Putamen_R_PercICV"
"M0_thalamus_proper_L","ThalamusProper_L"
"M0_thalamus_proper_L_PercICV","ThalamusProper_L_PercICV"
"M0_thalamus_proper_R","ThalamusProper_R"
"M0_thalamus_proper_R_PercICV","ThalamusProper_R_PercICV"
"M2_deep_GM","DeepGM"
"M2_deep_GM_PercICV","DeepGM_PercICV"
"M2_frontal_GM","Frontal_GM"
"M2_frontal_GM_PercICV","Frontal_GM_PercICV"
"M2_limbic_GM","Limbic_GM"
"M2_limbic_GM_PercICV","Limbic_GM_PercICV"
"M2_occipital_GM","Occipital_GM"
"M2_occipital_GM_PercICV","Occipital_GM_PercICV"
"M2_parietal_GM","Parietal_GM"
"M2_parietal_GM_PercICV","Parietal_GM_PercICV"
"M2_temporal_GM","Temporal_GM"
"M2_temporal_GM_PercICV","Temporal_GM_PercICV"
"M3_frontal","Frontal"
"M3_frontal_PercICV","Frontal_PercICV"
"M3_limbic","Limbic"
"M3_limbic_PercICV","Limbic_PercICV"
"M3_occipital","Occipital"
"M3_occipital_PercICV","Occipital_PercICV"
"M3_parietal","Parietal"
"M3_parietal_PercICV","Parietal_PercICV"
"M3_temporal","Temporal"
"M3_temporal_PercICV","Temporal_PercICV"
"M4_cort_CSF","CortCSF"
"M4_cort_CSF_PercICV","CortCSF_PercICV"
"M4_GM","GM"
"M4_GM_L","GM_L"
"M4_GM_L_PercICV","GM_L_PercICV"
"M4_GM_PercICV","GM_PercICV"
"M4_GM_R","GM_R"
"M4_GM_R_PercICV","GM_R_PercICV"
"M4_ventricles","Ventricles"
"M4_ventricles_PercICV","Ventricles_PercICV"
"M4_WM","WM"
"M4_WM_L","WM_L"
"M4_WM_L_PercICV","WM_L_PercICV"
"M4_WM_PercICV","WM_PercICV"
"M4_WM_R","WM_R"
"M4_WM_R_PercICV","WM_R_PercICV"
"M5_ICV","ICV"
"M5_total_brain","TotalBrain"
"M5_total_brain_PercICV","TotalBrain_PercICV"
"SPARE_AD","SPARE_AD"
"SPARE_BA","SPARE_BA"
10 changes: 10 additions & 0 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/List_centiles.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
fname
NiChart_ALL_AD_Centiles.csv
NiChart_ALL_CN_Centiles.csv
NiChart_ALL_MCI_Centiles.csv
NiChart_F_AD_Centiles.csv
NiChart_F_CN_Centiles.csv
NiChart_F_MCI_Centiles.csv
NiChart_M_AD_Centiles.csv
NiChart_M_CN_Centiles.csv
NiChart_M_MCI_Centiles.csv
5,122 changes: 2,561 additions & 2,561 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/NiChart_ALL_AD_Centiles.csv

Large diffs are not rendered by default.

6,814 changes: 3,407 additions & 3,407 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/NiChart_ALL_CN_Centiles.csv

Large diffs are not rendered by default.

4,826 changes: 2,413 additions & 2,413 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/NiChart_ALL_MCI_Centiles.csv

Large diffs are not rendered by default.

5,442 changes: 2,721 additions & 2,721 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/NiChart_F_AD_Centiles.csv

Large diffs are not rendered by default.

7,016 changes: 3,508 additions & 3,508 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/NiChart_F_CN_Centiles.csv

Large diffs are not rendered by default.

4,692 changes: 2,346 additions & 2,346 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/NiChart_F_MCI_Centiles.csv

Large diffs are not rendered by default.

4,762 changes: 2,381 additions & 2,381 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/NiChart_M_AD_Centiles.csv

Large diffs are not rendered by default.

7,018 changes: 3,509 additions & 3,509 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/NiChart_M_CN_Centiles.csv

Large diffs are not rendered by default.

4,826 changes: 2,413 additions & 2,413 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/NiChart_M_MCI_Centiles.csv

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions NiChart_Viewer/shared/centiles/NiChartcentiles/util_rename.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import pandas as pd

df1 = pd.read_csv('List_centiles.csv')
df2 = pd.read_csv('List_Map_Tmp.csv')

name_dict = dict(zip(df2['ROI1'], df2['ROI2']))



for fname in df1.fname:
dftmp = pd.read_csv(fname)

fnamenew = fname[0:-4] + '_OLD.csv'
print('From : ' + fnamenew)

dftmp.to_csv(fnamenew)
dftmp = dftmp.replace({"ROI_Name": name_dict})
dftmp.to_csv(fname)

print('To : ' + fname)

0 comments on commit 2ffdc45

Please sign in to comment.