PaIRS-UniNa 0.2.8__cp312-cp312-win_amd64.whl → 0.2.9__cp312-cp312-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. PaIRS_UniNa/Calibration_Tab.py +15 -0
  2. PaIRS_UniNa/Changes.txt +9 -0
  3. PaIRS_UniNa/Explorer.py +3158 -3126
  4. PaIRS_UniNa/FolderLoop.py +561 -561
  5. PaIRS_UniNa/Input_Tab.py +826 -826
  6. PaIRS_UniNa/Input_Tab_tools.py +3016 -3019
  7. PaIRS_UniNa/PaIRS.py +17 -17
  8. PaIRS_UniNa/SPIVCalHelp.py +155 -0
  9. PaIRS_UniNa/Saving_tools.py +277 -277
  10. PaIRS_UniNa/_PaIRS_PIV.pyd +0 -0
  11. PaIRS_UniNa/__init__.py +2 -2
  12. PaIRS_UniNa/gPaIRS.py +3890 -3889
  13. PaIRS_UniNa/icons/information.png +0 -0
  14. PaIRS_UniNa/icons/information2.png +0 -0
  15. PaIRS_UniNa/icons/spiv_setup_no.png +0 -0
  16. PaIRS_UniNa/icons/spiv_setup_ok.png +0 -0
  17. PaIRS_UniNa/listLib.py +301 -301
  18. PaIRS_UniNa/parForMulti.py +433 -433
  19. PaIRS_UniNa/tabSplitter.py +606 -606
  20. PaIRS_UniNa/ui_Calibration_Tab.py +575 -542
  21. PaIRS_UniNa/ui_Custom_Top.py +294 -294
  22. PaIRS_UniNa/ui_Input_Tab.py +1098 -1098
  23. PaIRS_UniNa/ui_Input_Tab_CalVi.py +1280 -1280
  24. PaIRS_UniNa/ui_Log_Tab.py +261 -261
  25. PaIRS_UniNa/ui_Output_Tab.py +2360 -2360
  26. PaIRS_UniNa/ui_Process_Tab.py +3808 -3808
  27. PaIRS_UniNa/ui_Process_Tab_CalVi.py +1547 -1547
  28. PaIRS_UniNa/ui_Process_Tab_Disp.py +1139 -1139
  29. PaIRS_UniNa/ui_Process_Tab_Min.py +435 -435
  30. PaIRS_UniNa/ui_ResizePopup.py +203 -203
  31. PaIRS_UniNa/ui_Vis_Tab.py +1626 -1626
  32. PaIRS_UniNa/ui_Vis_Tab_CalVi.py +1249 -1249
  33. PaIRS_UniNa/ui_Whatsnew.py +131 -131
  34. PaIRS_UniNa/ui_gPairs.py +873 -873
  35. PaIRS_UniNa/ui_infoPaIRS.py +550 -550
  36. PaIRS_UniNa/whatsnew.txt +1 -1
  37. {pairs_unina-0.2.8.dist-info → pairs_unina-0.2.9.dist-info}/METADATA +4 -3
  38. {pairs_unina-0.2.8.dist-info → pairs_unina-0.2.9.dist-info}/RECORD +40 -36
  39. {pairs_unina-0.2.8.dist-info → pairs_unina-0.2.9.dist-info}/WHEEL +0 -0
  40. {pairs_unina-0.2.8.dist-info → pairs_unina-0.2.9.dist-info}/top_level.txt +0 -0
PaIRS_UniNa/PaIRS.py CHANGED
@@ -1,18 +1,18 @@
1
1
  from .gPaIRS import *
2
-
3
- def run():
4
- gui:gPaIRS
5
- app,gui,flagPrint=launchPaIRS()
6
- quitPaIRS(app,flagPrint)
7
-
8
- def cleanRun():
9
- if os.path.exists(lastcfgname):
10
- os.remove(lastcfgname)
11
- run()
12
-
13
- def debugRun():
14
- gui:gPaIRS
15
- app,gui,flagPrint=launchPaIRS(flagInputDebug=True)
16
- quitPaIRS(app,flagPrint)
17
-
18
-
2
+
3
+ def run():
4
+ gui:gPaIRS
5
+ app,gui,flagPrint=launchPaIRS()
6
+ quitPaIRS(app,flagPrint)
7
+
8
+ def cleanRun():
9
+ if os.path.exists(lastcfgname):
10
+ os.remove(lastcfgname)
11
+ run()
12
+
13
+ def debugRun():
14
+ gui:gPaIRS
15
+ app,gui,flagPrint=launchPaIRS(flagInputDebug=True)
16
+ quitPaIRS(app,flagPrint)
17
+
18
+
@@ -0,0 +1,155 @@
1
+ from PySide6 import QtWidgets, QtGui, QtCore
2
+ import sys
3
+ from .PaIRS_pypacks import icons_path, fontPixelSize
4
+
5
+ def showSPIVCalHelp(parent=None,disable_callback=None):
6
+ """
7
+ Shows an informational dialog explaining the correct calibration setup
8
+ for stereoscopic PIV in PaIRS, ensuring compatibility with disparity
9
+ correction and full stereoscopic reconstruction.
10
+ """
11
+ dlg = QtWidgets.QDialog(parent)
12
+ dlg.setWindowTitle("Guidelines for stereoscopic PIV calibration")
13
+ #dlg.resize(900, 750)
14
+ dlg.setMinimumWidth(900)
15
+ dlg.setMinimumHeight(750)
16
+
17
+ main_layout = QtWidgets.QVBoxLayout(dlg)
18
+
19
+ # --- Explanatory text (English, corrected axes) ---
20
+ text = (
21
+ "For stereoscopic PIV, PaIRS assumes that:<br><br>"
22
+
23
+ "&nbsp;&nbsp;• the <b>calibration plate defines "
24
+ "the x–y plane</b> of the calibration coordinate system;<br>"
25
+
26
+ "&nbsp;&nbsp;• the <b>x-axis</b> is <b>aligned with the stereoscopic baseline</b>, i.e. "
27
+ "the direction along which the projections of the two camera viewing rays diverge "
28
+ "on the calibration plate (the dominant disparity direction);<br>"
29
+
30
+ "&nbsp;&nbsp;• the <b>y-axis</b> is then defined as the axis <b>perpendicular to the plane containing "
31
+ "the two cameras</b> (i.e. perpendicular to the triangulation plane formed by the two "
32
+ "optical axes);<br>"
33
+
34
+ "&nbsp;&nbsp;• the <b>z-axis is normal to the plate</b> (typically pointing towards the cameras).<br><br>"
35
+
36
+ "To ensure full compatibility with the operations performed in the disparity correction step and the stereoscopic reconstruction,"
37
+ " the calibration procedure must always adhere to the above coordinate convention.<br>"
38
+ " The example below shows a <b>correct</b> configuration (left) and an <b>incorrect</b> one (right).<br>"
39
+ )
40
+
41
+ text_label = QtWidgets.QLabel()
42
+ text_label.setWordWrap(True)
43
+ text_label.setTextFormat(QtCore.Qt.RichText)
44
+ text_label.setText(f"<div>{text}</div>")
45
+ main_layout.addWidget(text_label)
46
+ font=dlg.font()
47
+ font.setPixelSize(fontPixelSize+4)
48
+ text_label.setFont(font)
49
+
50
+ # --- Side-by-side images ---
51
+ img_layout = QtWidgets.QHBoxLayout()
52
+ img_layout.setSpacing(10)
53
+ main_layout.addLayout(img_layout)
54
+
55
+ # Paths to images (adjust to match PaIRS resources folder)
56
+ img_ok_path = icons_path+"spiv_setup_ok.png"
57
+ img_no_path = icons_path+"spiv_setup_no.png"
58
+
59
+ # --- Correct configuration image ---
60
+ ok_widget = QtWidgets.QVBoxLayout()
61
+ ok_caption = QtWidgets.QLabel()
62
+ caption_text = "<b>Correct configuration (x–z stereo plane)</b>"
63
+ ok_caption.setText(f"<div>{caption_text}</div>")
64
+ ok_caption.setFont(font)
65
+ ok_caption.setTextFormat(QtCore.Qt.RichText)
66
+ ok_caption.setAlignment(QtCore.Qt.AlignCenter)
67
+
68
+ ok_label_img = QtWidgets.QLabel()
69
+ ok_label_img.setAlignment(QtCore.Qt.AlignCenter)
70
+ ok_label_img.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
71
+ ok_label_img.setScaledContents(True)
72
+
73
+ ok_pix = QtGui.QPixmap(img_ok_path)
74
+ if not ok_pix.isNull():
75
+ ok_pix = ok_pix.scaledToWidth(400, QtCore.Qt.SmoothTransformation)
76
+ ok_label_img.setPixmap(ok_pix)
77
+ ok_label_img.setFixedSize(ok_pix.width(),ok_pix.height())
78
+
79
+ ok_widget.addWidget(ok_caption)
80
+ ok_widget.addWidget(ok_label_img)
81
+ img_layout.addLayout(ok_widget)
82
+
83
+ # --- Incorrect configuration image ---
84
+ no_widget = QtWidgets.QVBoxLayout()
85
+ no_caption = QtWidgets.QLabel()
86
+ caption_text = "<b>Incorrect configuration</b>"
87
+ no_caption.setText(f"<div'>{caption_text}</div>")
88
+ no_caption.setFont(font)
89
+ no_caption.setTextFormat(QtCore.Qt.RichText)
90
+ no_caption.setAlignment(QtCore.Qt.AlignCenter)
91
+
92
+ no_label_img = QtWidgets.QLabel()
93
+ no_label_img.setAlignment(QtCore.Qt.AlignCenter)
94
+ no_label_img.setSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
95
+ no_label_img.setScaledContents(True)
96
+
97
+ no_pix = QtGui.QPixmap(img_no_path)
98
+ if not no_pix.isNull():
99
+ no_pix = no_pix.scaledToWidth(400, QtCore.Qt.SmoothTransformation)
100
+ no_label_img.setPixmap(no_pix)
101
+ no_label_img.setFixedSize(no_pix.width(),no_pix.height())
102
+
103
+ no_widget.addWidget(no_caption)
104
+ no_widget.addWidget(no_label_img)
105
+ img_layout.addLayout(no_widget)
106
+
107
+ # Prevent bottom clipping: allow images row to shrink/expand as needed
108
+ main_layout.setStretch(0, 1)
109
+ main_layout.setStretch(1, 0)
110
+
111
+ # Create a horizontal layout for buttons
112
+ button_layout = QtWidgets.QHBoxLayout()
113
+
114
+ # Spacer pushes OK to the right
115
+ button_layout.addStretch(1)
116
+
117
+ # Left button
118
+ if disable_callback is not None:
119
+ button_disable = QtWidgets.QPushButton("Don't show this message again")
120
+ def on_disable():
121
+ disable_callback()
122
+ dlg.accept()
123
+ button_disable.clicked.connect(on_disable)
124
+ button_layout.addWidget(button_disable)
125
+
126
+ # Right button (OK)
127
+ button_ok = QtWidgets.QPushButton("OK")
128
+ def on_ok():
129
+ dlg.accept()
130
+ button_ok.clicked.connect(on_ok)
131
+ button_layout.addWidget(button_ok)
132
+
133
+ # Add the layout to the dialog
134
+ main_layout.addSpacing(12)
135
+ main_layout.addLayout(button_layout)
136
+
137
+ button_ok.setDefault(True)
138
+ button_ok.setFocus()
139
+
140
+ main_layout.setContentsMargins(20, 25, 20, 25) # slightly larger bottom margin to avoid macOS clipping
141
+
142
+ dlg.exec()
143
+
144
+ if __name__ == "__main__":
145
+ # QApplication MUST be created before any QWidget
146
+ app = QtWidgets.QApplication(sys.argv)
147
+
148
+ # Parent window (optional)
149
+ main_window = QtWidgets.QMainWindow()
150
+ main_window.show()
151
+
152
+ # Show the SPIV calibration dialog
153
+ showSPIVCalHelp(parent=main_window)
154
+
155
+ sys.exit(app.exec())