🚀 feat(README.md): add support for .stl file format

🐛 fix(data_processing.py): fix typo in advanced data keys and add R_max to advanced data
 feat(MainWindow.py): add support for exporting advanced data to a text file
🎨 style(MainWindow.ui, UI_MainWindow.py): change the display of advanced data labels to use <R> instead of 〈R〉 and σ<R> instead of σ〈R〉
The README.md file now reflects the fact that the tool can now read .stl files. The advanced data keys in data_processing.py have been fixed to use the correct symbols and R_max has been added to the advanced data. The MainWindow.py now allows the user to export the advanced data to a text file. The display of advanced data labels in MainWindow.ui and UI_MainWindow.py has been changed to use <R> instead of 〈
This commit is contained in:
Djalim Simaila 2023-05-15 13:42:46 +02:00
parent 5babe707c6
commit 70b4e11b62
5 changed files with 25 additions and 21 deletions

View File

@ -8,7 +8,7 @@ L'outil dispose des fonctionnalités suivantes :
### Analyse de l'objet
- Lecture de fichiers .obj et .xyz
- Lecture de fichiers .obj, .xyz et .stl
- Redressement et normalisation de l'objet
- Discrétisation de l'objet en couches de taille égale
- Calcul d'indices morphologiques

View File

@ -122,9 +122,9 @@ def get_advanced_data(discrete_data:dict, V_scan = 0, update_progress_bar= progr
- Tortuosite
- Volume en mm3
- Surface en mm2
- Moyenne des rayons moyens R
- Ecart-type des rayons moyens σ_R
- σ_R^tot
- Moyenne des rayons moyens <R>
- Ecart-type des rayons moyens σ_<R>
- σ_<R>^tot
- MI_l
- MI_p
- Rayon hydraulique R_h
@ -158,10 +158,10 @@ def get_advanced_data(discrete_data:dict, V_scan = 0, update_progress_bar= progr
MI_p = np.sqrt(mean_sigma_r_squared)/R_mean
R_max = max(all_R)
R_in = 40
MI_mR = R_max/R_mean
MI_mH = R_max/H
#MI_mr_in = R_max/R_in
# TODO understand what is R_in
MI_mr_in = R_max/R_in
R_V_scan = np.sqrt(V_scan/np.pi*H)
S_V_scan = 2 * np.sqrt(np.pi * H * V_scan)
R_h = R2_mean/ R_mean
@ -171,17 +171,19 @@ def get_advanced_data(discrete_data:dict, V_scan = 0, update_progress_bar= progr
"Tortuosité":T,
"Volume en mm3":V,
"Surface en mm2":S,
"Moyenne des rayons moyens 〈R〉":R_mean,
"Ecart-type des rayons moyens σ_〈R〉":R_mean_std,
"σ_〈R〉^tot":sigma_r_tot,
"<R>":R_mean,
"<R²>":R2_mean,
"σ_<R>":R_mean_std,
"σ_<R>^tot":sigma_r_tot,
"H": H,
"L": L,
"l":l,
"MI_l":MI_l,
"MI_p":MI_p,
"R_max":R_max,
"MI_mR":MI_mR,
"MI_mH":MI_mH,
# "MI_mr_in":MI_mr_in,
"MI_mR_in":MI_mr_in,
"V_scan":V_scan,
"R_V_scan":R_V_scan,
"S_V_scan":S_V_scan,

View File

@ -362,14 +362,14 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
self.tortuosity.setValue(advanced_data["Tortuosité"])
self.volume.setValue(advanced_data["Volume en mm3"])
self.surface.setValue(advanced_data["Surface en mm2"])
self.mean_r_mean.setValue(advanced_data["Moyenne des rayons moyens 〈R〉"])
self.sigma_r_mean.setValue(advanced_data["Ecart-type des rayons moyens σ_〈R〉"])
self.sigma_r_tot.setValue(advanced_data["σ_〈R〉^tot"])
self.mean_r_mean.setValue(advanced_data["<R>"])
self.sigma_r_mean.setValue(advanced_data["σ_<R>"])
self.sigma_r_tot.setValue(advanced_data["σ_<R>^tot"])
self.MI_l.setValue(advanced_data["MI_l"])
self.MI_p.setValue(advanced_data["MI_p"])
self.MI_mR.setValue(advanced_data["MI_mR"])
self.MI_mH.setValue(advanced_data["MI_mH"])
#self.MI_mR_in.setValue(advanced_data["MI_mR_in"])
self.MI_mR_in.setValue(advanced_data["MI_mR_in"])
self.V_scan.setValue(advanced_data["V_scan"])
self.R_V_scan.setValue(advanced_data["R_V_scan"])
self.S_V_scan.setValue(advanced_data["S_V_scan"])
@ -387,6 +387,8 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
"Exporter les indicateurs morphologiques",
"./",
"Fichier texte (*.txt)")
if file_path[0] == "":
return
advanced_data = {key : [round(value,6),] for key,value in self.advanced_data.items()}
string_data = format_data(advanced_data,SettingManager.get_instance().get_setting("output_file_separator"))
save_output_file(file_path[0],string_data)
@ -484,7 +486,7 @@ class MainWindow(QtWidgets.QMainWindow, Ui_MainWindow):
if not self.show_graph_checkbox.isChecked():
return
self.set_status("Renderingc discretes graphs... this may take a moment")
self.set_status("Rendering discretes graphs... this may take a moment")
for slot in self.slots:
current_slot = slot[0]
graph_type = slot[1]

View File

@ -464,7 +464,7 @@
<item row="12" column="0">
<widget class="QLabel" name="mean_r_mean_label">
<property name="text">
<string>Moyenne des rayons moyens 〈R〉</string>
<string>Moyenne des rayons moyens <R></string>
</property>
</widget>
</item>
@ -490,7 +490,7 @@
<item row="13" column="0">
<widget class="QLabel" name="sigma_r_mean_label">
<property name="text">
<string>Ecart type des rayons moyens σ〈R〉</string>
<string>Ecart type des rayons moyens σ<R></string>
</property>
</widget>
</item>
@ -516,7 +516,7 @@
<item row="14" column="0">
<widget class="QLabel" name="sigma_r_tot_label">
<property name="text">
<string>σ〈R〉^tot</string>
<string>σ<R>^tot</string>
</property>
</widget>
</item>

View File

@ -623,9 +623,9 @@ class Ui_MainWindow(object):
self.tortuosity_label.setText(_translate("MainWindow", "Tortuosité"))
self.volume_label.setText(_translate("MainWindow", "Volume en mm³"))
self.surface_label.setText(_translate("MainWindow", "Surface en mm²"))
self.mean_r_mean_label.setText(_translate("MainWindow", "Moyenne des rayons moyens 〈R〉"))
self.sigma_r_mean_label.setText(_translate("MainWindow", "Ecart type des rayons moyens σ〈R〉"))
self.sigma_r_tot_label.setText(_translate("MainWindow", "σ〈R〉^tot"))
self.mean_r_mean_label.setText(_translate("MainWindow", "Moyenne des rayons moyens <R>"))
self.sigma_r_mean_label.setText(_translate("MainWindow", "Ecart type des rayons moyens σ<R>"))
self.sigma_r_tot_label.setText(_translate("MainWindow", "σ<R>^tot"))
self.MI_p_label.setText(_translate("MainWindow", "MI_p"))
self.MI_l_label.setText(_translate("MainWindow", "MI_l"))
self.R_h_label.setText(_translate("MainWindow", "Rayon hydraulique R_h"))