PaIRS-UniNa 0.1.13__cp310-cp310-win_amd64.whl → 0.2.8__cp310-cp310-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 (292) hide show
  1. PaIRS_UniNa/Calibration_Tab.py +331 -0
  2. PaIRS_UniNa/Changes.txt +134 -2
  3. PaIRS_UniNa/Custom_Top.py +299 -299
  4. PaIRS_UniNa/Explorer.py +3136 -0
  5. PaIRS_UniNa/FolderLoop.py +562 -0
  6. PaIRS_UniNa/Input_Tab.py +831 -0
  7. PaIRS_UniNa/Input_Tab_CalVi.py +786 -0
  8. PaIRS_UniNa/Input_Tab_tools.py +3025 -0
  9. PaIRS_UniNa/Log_Tab.py +57 -14
  10. PaIRS_UniNa/Output_Tab.py +922 -0
  11. PaIRS_UniNa/PaIRS_PIV.py +111 -18
  12. PaIRS_UniNa/PaIRS_pypacks.py +698 -140
  13. PaIRS_UniNa/Process_Tab.py +1221 -1402
  14. PaIRS_UniNa/Process_Tab_CalVi.py +137 -262
  15. PaIRS_UniNa/Process_Tab_Disp.py +163 -0
  16. PaIRS_UniNa/Process_Tab_Min.py +120 -0
  17. PaIRS_UniNa/Saving_tools.py +296 -0
  18. PaIRS_UniNa/TabTools.py +863 -543
  19. PaIRS_UniNa/Vis_Tab.py +1898 -1315
  20. PaIRS_UniNa/Vis_Tab_CalVi.py +484 -356
  21. PaIRS_UniNa/Whatsnew.py +59 -10
  22. PaIRS_UniNa/_PaIRS_PIV.pyd +0 -0
  23. PaIRS_UniNa/__init__.py +4 -3
  24. PaIRS_UniNa/addwidgets_ps.py +326 -56
  25. PaIRS_UniNa/calib.py +19 -12
  26. PaIRS_UniNa/calibView.py +48 -25
  27. PaIRS_UniNa/gPaIRS.py +3902 -3461
  28. PaIRS_UniNa/gPalette.py +189 -170
  29. PaIRS_UniNa/icons/align_all.png +0 -0
  30. PaIRS_UniNa/icons/announcement.png +0 -0
  31. PaIRS_UniNa/icons/automatic_levels_off.png +0 -0
  32. PaIRS_UniNa/icons/automatic_levels_on.png +0 -0
  33. PaIRS_UniNa/icons/automatic_off.png +0 -0
  34. PaIRS_UniNa/icons/automatic_on.png +0 -0
  35. PaIRS_UniNa/icons/automatic_size_off.png +0 -0
  36. PaIRS_UniNa/icons/automatic_size_on.png +0 -0
  37. PaIRS_UniNa/icons/bin_off.png +0 -0
  38. PaIRS_UniNa/icons/bin_on.png +0 -0
  39. PaIRS_UniNa/icons/brush_cursor.png +0 -0
  40. PaIRS_UniNa/icons/bugfix.png +0 -0
  41. PaIRS_UniNa/icons/cal_proc.png +0 -0
  42. PaIRS_UniNa/icons/cal_proc_off.png +0 -0
  43. PaIRS_UniNa/icons/cal_step.png +0 -0
  44. PaIRS_UniNa/icons/cal_step_off.png +0 -0
  45. PaIRS_UniNa/icons/calibration_logo.png +0 -0
  46. PaIRS_UniNa/icons/change_folder.png +0 -0
  47. PaIRS_UniNa/icons/change_folder_off.png +0 -0
  48. PaIRS_UniNa/icons/close_all.png +0 -0
  49. PaIRS_UniNa/icons/close_workspace.png +0 -0
  50. PaIRS_UniNa/icons/colormap.png +0 -0
  51. PaIRS_UniNa/icons/colormaps/Accent.png +0 -0
  52. PaIRS_UniNa/icons/colormaps/BrBG.png +0 -0
  53. PaIRS_UniNa/icons/colormaps/Dark2.png +0 -0
  54. PaIRS_UniNa/icons/colormaps/PRGn.png +0 -0
  55. PaIRS_UniNa/icons/colormaps/Paired.png +0 -0
  56. PaIRS_UniNa/icons/colormaps/Pastel1.png +0 -0
  57. PaIRS_UniNa/icons/colormaps/Pastel2.png +0 -0
  58. PaIRS_UniNa/icons/colormaps/PiYG.png +0 -0
  59. PaIRS_UniNa/icons/colormaps/PuOr.png +0 -0
  60. PaIRS_UniNa/icons/colormaps/RdBu.png +0 -0
  61. PaIRS_UniNa/icons/colormaps/RdGy.png +0 -0
  62. PaIRS_UniNa/icons/colormaps/RdYlBu.png +0 -0
  63. PaIRS_UniNa/icons/colormaps/RdYlGn.png +0 -0
  64. PaIRS_UniNa/icons/colormaps/Set1.png +0 -0
  65. PaIRS_UniNa/icons/colormaps/Set2.png +0 -0
  66. PaIRS_UniNa/icons/colormaps/Set3.png +0 -0
  67. PaIRS_UniNa/icons/colormaps/Spectral.png +0 -0
  68. PaIRS_UniNa/icons/colormaps/Wistia.png +0 -0
  69. PaIRS_UniNa/icons/colormaps/afmhot.png +0 -0
  70. PaIRS_UniNa/icons/colormaps/autumn.png +0 -0
  71. PaIRS_UniNa/icons/colormaps/binary.png +0 -0
  72. PaIRS_UniNa/icons/colormaps/blackVector.png +0 -0
  73. PaIRS_UniNa/icons/colormaps/blueVector.png +0 -0
  74. PaIRS_UniNa/icons/colormaps/bone.png +0 -0
  75. PaIRS_UniNa/icons/colormaps/brg.png +0 -0
  76. PaIRS_UniNa/icons/colormaps/bwr.png +0 -0
  77. PaIRS_UniNa/icons/colormaps/cividis.png +0 -0
  78. PaIRS_UniNa/icons/colormaps/cool.png +0 -0
  79. PaIRS_UniNa/icons/colormaps/coolwarm.png +0 -0
  80. PaIRS_UniNa/icons/colormaps/copper.png +0 -0
  81. PaIRS_UniNa/icons/colormaps/cubehelix.png +0 -0
  82. PaIRS_UniNa/icons/colormaps/cyanVector.png +0 -0
  83. PaIRS_UniNa/icons/colormaps/flag.png +0 -0
  84. PaIRS_UniNa/icons/colormaps/gist_heat.png +0 -0
  85. PaIRS_UniNa/icons/colormaps/gray.png +0 -0
  86. PaIRS_UniNa/icons/colormaps/greenVector.png +0 -0
  87. PaIRS_UniNa/icons/colormaps/hot.png +0 -0
  88. PaIRS_UniNa/icons/colormaps/hsv.png +0 -0
  89. PaIRS_UniNa/icons/colormaps/inferno.png +0 -0
  90. PaIRS_UniNa/icons/colormaps/jet.png +0 -0
  91. PaIRS_UniNa/icons/colormaps/magentaVector.png +0 -0
  92. PaIRS_UniNa/icons/colormaps/magma.png +0 -0
  93. PaIRS_UniNa/icons/colormaps/ocean.png +0 -0
  94. PaIRS_UniNa/icons/colormaps/pink.png +0 -0
  95. PaIRS_UniNa/icons/colormaps/plasma.png +0 -0
  96. PaIRS_UniNa/icons/colormaps/prism.png +0 -0
  97. PaIRS_UniNa/icons/colormaps/rainbow.png +0 -0
  98. PaIRS_UniNa/icons/colormaps/redVector.png +0 -0
  99. PaIRS_UniNa/icons/colormaps/seismic.png +0 -0
  100. PaIRS_UniNa/icons/colormaps/spring.png +0 -0
  101. PaIRS_UniNa/icons/colormaps/summer.png +0 -0
  102. PaIRS_UniNa/icons/colormaps/tab10.png +0 -0
  103. PaIRS_UniNa/icons/colormaps/tab20.png +0 -0
  104. PaIRS_UniNa/icons/colormaps/tab20b.png +0 -0
  105. PaIRS_UniNa/icons/colormaps/tab20c.png +0 -0
  106. PaIRS_UniNa/icons/colormaps/terrain.png +0 -0
  107. PaIRS_UniNa/icons/colormaps/twilight.png +0 -0
  108. PaIRS_UniNa/icons/colormaps/viridis.png +0 -0
  109. PaIRS_UniNa/icons/colormaps/whiteVector.png +0 -0
  110. PaIRS_UniNa/icons/colormaps/winter.png +0 -0
  111. PaIRS_UniNa/icons/colormaps/yellowVector.png +0 -0
  112. PaIRS_UniNa/icons/common_region.png +0 -0
  113. PaIRS_UniNa/icons/common_region_off.png +0 -0
  114. PaIRS_UniNa/icons/completed.png +0 -0
  115. PaIRS_UniNa/icons/contourf_off.png +0 -0
  116. PaIRS_UniNa/icons/contourf_on.png +0 -0
  117. PaIRS_UniNa/icons/copy.png +0 -0
  118. PaIRS_UniNa/icons/copy_process.png +0 -0
  119. PaIRS_UniNa/icons/copy_process_off.png +0 -0
  120. PaIRS_UniNa/icons/cut.png +0 -0
  121. PaIRS_UniNa/icons/cut_warnings.png +0 -0
  122. PaIRS_UniNa/icons/darkmode.png +0 -0
  123. PaIRS_UniNa/icons/disp_step.png +0 -0
  124. PaIRS_UniNa/icons/disp_step_off.png +0 -0
  125. PaIRS_UniNa/icons/edit_list.png +0 -0
  126. PaIRS_UniNa/icons/example_list.png +0 -0
  127. PaIRS_UniNa/icons/flaticon_PaIRS_beta.png +0 -0
  128. PaIRS_UniNa/icons/flaticon_PaIRS_download_warning.png +0 -0
  129. PaIRS_UniNa/icons/flip_y_off.png +0 -0
  130. PaIRS_UniNa/icons/flip_y_on.png +0 -0
  131. PaIRS_UniNa/icons/folder_loop_cleanup.png +0 -0
  132. PaIRS_UniNa/icons/folder_loop_cleanup_off.png +0 -0
  133. PaIRS_UniNa/icons/gear.gif +0 -0
  134. PaIRS_UniNa/icons/gear.png +0 -0
  135. PaIRS_UniNa/icons/import_set.png +0 -0
  136. PaIRS_UniNa/icons/information.png +0 -0
  137. PaIRS_UniNa/icons/input_logo.png +0 -0
  138. PaIRS_UniNa/icons/issue.png +0 -0
  139. PaIRS_UniNa/icons/laser_NTR.png +0 -0
  140. PaIRS_UniNa/icons/laser_TR_double.png +0 -0
  141. PaIRS_UniNa/icons/laser_TR_single.png +0 -0
  142. PaIRS_UniNa/icons/link.png +0 -0
  143. PaIRS_UniNa/icons/linked.png +0 -0
  144. PaIRS_UniNa/icons/log_logo.png +0 -0
  145. PaIRS_UniNa/icons/logo_opaco.png +0 -0
  146. PaIRS_UniNa/icons/measure.png +0 -0
  147. PaIRS_UniNa/icons/measure_off.png +0 -0
  148. PaIRS_UniNa/icons/min_proc.png +0 -0
  149. PaIRS_UniNa/icons/min_proc_off.png +0 -0
  150. PaIRS_UniNa/icons/min_step.png +0 -0
  151. PaIRS_UniNa/icons/min_step_off.png +0 -0
  152. PaIRS_UniNa/icons/new_workspace.png +0 -0
  153. PaIRS_UniNa/icons/open_image.png +0 -0
  154. PaIRS_UniNa/icons/open_new_window.png +0 -0
  155. PaIRS_UniNa/icons/open_result.png +0 -0
  156. PaIRS_UniNa/icons/open_workspace.png +0 -0
  157. PaIRS_UniNa/icons/output_logo.png +0 -0
  158. PaIRS_UniNa/icons/paste_above.png +0 -0
  159. PaIRS_UniNa/icons/paste_below.png +0 -0
  160. PaIRS_UniNa/icons/paused.png +0 -0
  161. PaIRS_UniNa/icons/piv_proc.png +0 -0
  162. PaIRS_UniNa/icons/piv_proc_off.png +0 -0
  163. PaIRS_UniNa/icons/piv_step.png +0 -0
  164. PaIRS_UniNa/icons/piv_step_off.png +0 -0
  165. PaIRS_UniNa/icons/process_logo.png +0 -0
  166. PaIRS_UniNa/icons/process_loop.png +0 -0
  167. PaIRS_UniNa/icons/project.png +0 -0
  168. PaIRS_UniNa/icons/pylog.png +0 -0
  169. PaIRS_UniNa/icons/python_warning.png +0 -0
  170. PaIRS_UniNa/icons/queue.png +0 -0
  171. PaIRS_UniNa/icons/read.png +0 -0
  172. PaIRS_UniNa/icons/read_list.png +0 -0
  173. PaIRS_UniNa/icons/reset.png +0 -0
  174. PaIRS_UniNa/icons/reset_levels.png +0 -0
  175. PaIRS_UniNa/icons/restore_undo.png +0 -0
  176. PaIRS_UniNa/icons/running.gif +0 -0
  177. PaIRS_UniNa/icons/running.png +0 -0
  178. PaIRS_UniNa/icons/running_warn.png +0 -0
  179. PaIRS_UniNa/icons/save_and_stop.png +0 -0
  180. PaIRS_UniNa/icons/save_cfg.png +0 -0
  181. PaIRS_UniNa/icons/saveas_workspace.png +0 -0
  182. PaIRS_UniNa/icons/scale_all.png +0 -0
  183. PaIRS_UniNa/icons/scale_down.png +0 -0
  184. PaIRS_UniNa/icons/scale_up.png +0 -0
  185. PaIRS_UniNa/icons/scan_list.png +0 -0
  186. PaIRS_UniNa/icons/scan_path.png +0 -0
  187. PaIRS_UniNa/icons/scan_path_loop.png +0 -0
  188. PaIRS_UniNa/icons/scan_path_loop_off.png +0 -0
  189. PaIRS_UniNa/icons/search.png +0 -0
  190. PaIRS_UniNa/icons/showIW_off.png +0 -0
  191. PaIRS_UniNa/icons/showIW_on.png +0 -0
  192. PaIRS_UniNa/icons/show_all.png +0 -0
  193. PaIRS_UniNa/icons/sort.png +0 -0
  194. PaIRS_UniNa/icons/sort_reversed.png +0 -0
  195. PaIRS_UniNa/icons/spiv_proc.png +0 -0
  196. PaIRS_UniNa/icons/spiv_proc_off.png +0 -0
  197. PaIRS_UniNa/icons/star.png +0 -0
  198. PaIRS_UniNa/icons/step_inheritance.png +0 -0
  199. PaIRS_UniNa/icons/subMIN_off.png +0 -0
  200. PaIRS_UniNa/icons/subMIN_on.png +0 -0
  201. PaIRS_UniNa/icons/unedited.png +0 -0
  202. PaIRS_UniNa/icons/uninitialized.png +0 -0
  203. PaIRS_UniNa/icons/unlink.png +0 -0
  204. PaIRS_UniNa/icons/unwrap_items.png +0 -0
  205. PaIRS_UniNa/icons/vectorColor.png +0 -0
  206. PaIRS_UniNa/icons/view.png +0 -0
  207. PaIRS_UniNa/icons/view_off.png +0 -0
  208. PaIRS_UniNa/icons/vis_logo.png +0 -0
  209. PaIRS_UniNa/icons/warning_circle.png +0 -0
  210. PaIRS_UniNa/icons/window.png +0 -0
  211. PaIRS_UniNa/icons/workspace.png +0 -0
  212. PaIRS_UniNa/icons/wrap_items.png +0 -0
  213. PaIRS_UniNa/icons/write_list.png +0 -0
  214. PaIRS_UniNa/listLib.py +303 -0
  215. PaIRS_UniNa/mtfPIV.py +8 -8
  216. PaIRS_UniNa/parForMulti.py +7 -5
  217. PaIRS_UniNa/parForWorkers.py +370 -31
  218. PaIRS_UniNa/pivParFor.py +233 -229
  219. PaIRS_UniNa/plt_util.py +141 -141
  220. PaIRS_UniNa/preProcParFor.py +153 -148
  221. PaIRS_UniNa/procTools.py +631 -178
  222. PaIRS_UniNa/readcfg.py +31 -1
  223. PaIRS_UniNa/rqrdpckgs.txt +9 -0
  224. PaIRS_UniNa/stereoPivParFor.py +227 -0
  225. PaIRS_UniNa/tAVarie.py +215 -215
  226. PaIRS_UniNa/tabSplitter.py +612 -0
  227. PaIRS_UniNa/ui_Calibration_Tab.py +545 -0
  228. PaIRS_UniNa/ui_Custom_Top.py +5 -5
  229. PaIRS_UniNa/ui_Input_Tab.py +1101 -0
  230. PaIRS_UniNa/{ui_Import_Tab_CalVi.py → ui_Input_Tab_CalVi.py} +1282 -1275
  231. PaIRS_UniNa/ui_Log_Tab.py +262 -257
  232. PaIRS_UniNa/{ui_Export_Tab.py → ui_Output_Tab.py} +2361 -1778
  233. PaIRS_UniNa/ui_Process_Tab.py +3809 -3758
  234. PaIRS_UniNa/ui_Process_Tab_CalVi.py +1547 -1546
  235. PaIRS_UniNa/ui_Process_Tab_Disp.py +1141 -0
  236. PaIRS_UniNa/ui_Process_Tab_Min.py +437 -0
  237. PaIRS_UniNa/ui_Vis_Tab.py +1626 -1208
  238. PaIRS_UniNa/ui_Vis_Tab_CalVi.py +1249 -1249
  239. PaIRS_UniNa/ui_Whatsnew.py +131 -131
  240. PaIRS_UniNa/ui_gPairs.py +876 -950
  241. PaIRS_UniNa/ui_infoPaIRS.py +550 -425
  242. PaIRS_UniNa/whatsnew.txt +6 -4
  243. {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/METADATA +69 -51
  244. pairs_unina-0.2.8.dist-info/RECORD +329 -0
  245. {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/WHEEL +1 -1
  246. PaIRS_UniNa/CalVi.py +0 -18
  247. PaIRS_UniNa/Export_Tab.py +0 -574
  248. PaIRS_UniNa/Import_Tab.py +0 -657
  249. PaIRS_UniNa/Import_Tab_CalVi.py +0 -861
  250. PaIRS_UniNa/Import_Tab_tools.py +0 -598
  251. PaIRS_UniNa/Tree_Tab.py +0 -543
  252. PaIRS_UniNa/gCalVi.py +0 -2024
  253. PaIRS_UniNa/icons/add.png +0 -0
  254. PaIRS_UniNa/icons/cancelled.png +0 -0
  255. PaIRS_UniNa/icons/chain.png +0 -0
  256. PaIRS_UniNa/icons/chain_broken.png +0 -0
  257. PaIRS_UniNa/icons/default_sizes.png +0 -0
  258. PaIRS_UniNa/icons/dock_tabs.png +0 -0
  259. PaIRS_UniNa/icons/done.png +0 -0
  260. PaIRS_UniNa/icons/down_arrow.png +0 -0
  261. PaIRS_UniNa/icons/export_logo.png +0 -0
  262. PaIRS_UniNa/icons/fast_delete.png +0 -0
  263. PaIRS_UniNa/icons/flip_y.png +0 -0
  264. PaIRS_UniNa/icons/ganci.png +0 -0
  265. PaIRS_UniNa/icons/import_blue.png +0 -0
  266. PaIRS_UniNa/icons/import_logo.png +0 -0
  267. PaIRS_UniNa/icons/missing.png +0 -0
  268. PaIRS_UniNa/icons/process_icon.png +0 -0
  269. PaIRS_UniNa/icons/processing.png +0 -0
  270. PaIRS_UniNa/icons/restart.png +0 -0
  271. PaIRS_UniNa/icons/right_arrow.png +0 -0
  272. PaIRS_UniNa/icons/run_piv.png +0 -0
  273. PaIRS_UniNa/icons/terminal.png +0 -0
  274. PaIRS_UniNa/icons/undock_tabs.png +0 -0
  275. PaIRS_UniNa/icons/vect_field.png +0 -0
  276. PaIRS_UniNa/icons/w0.png +0 -0
  277. PaIRS_UniNa/icons/w1.png +0 -0
  278. PaIRS_UniNa/icons/w2.png +0 -0
  279. PaIRS_UniNa/icons/w3.png +0 -0
  280. PaIRS_UniNa/icons/w4.png +0 -0
  281. PaIRS_UniNa/icons/w5.png +0 -0
  282. PaIRS_UniNa/run_CalVi.py +0 -14
  283. PaIRS_UniNa/run_gcalvi.py +0 -5
  284. PaIRS_UniNa/ui_Import_Tab.py +0 -1077
  285. PaIRS_UniNa/ui_Tree_Tab.py +0 -684
  286. PaIRS_UniNa/ui_gCalVi.py +0 -640
  287. PaIRS_UniNa/ui_infoCalVi.py +0 -428
  288. PaIRS_UniNa-0.1.13.dist-info/LICENSE +0 -19
  289. PaIRS_UniNa-0.1.13.dist-info/RECORD +0 -174
  290. /PaIRS_UniNa/icons/{clean_queue.png → clean.png} +0 -0
  291. /PaIRS_UniNa/icons/{waiting_c.png → sandglass.png} +0 -0
  292. {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/top_level.txt +0 -0
@@ -1,598 +0,0 @@
1
- from .PaIRS_pypacks import*
2
-
3
- #Ncont=500
4
-
5
- class patternInfoList:
6
- def __init__(self):
7
- self.pattern= []
8
- self.ext= []
9
- self.root= []
10
- self.pa= []
11
- self.n= []
12
- self.ndig= []
13
- self.nab= []
14
- self.nimg= []
15
- self.nimg_tot= []
16
- self.ind_in= []
17
- self.ind_fin= []
18
- self.fra= []
19
- self.nfra= []
20
-
21
- def addto(self,S):
22
- for field, f in S.__dict__.items():
23
- s_value=getattr(self,field)
24
- if type(s_value)==list:
25
- for x in s_value:
26
- f.append(x)
27
- else:
28
- f.append(s_value)
29
- return S
30
-
31
- def copyto(self,S):
32
- for field, value in self.__dict__.items():
33
- setattr(S,field,value)
34
- return S
35
-
36
- def duplicate(self):
37
- S=patternInfoList()
38
- for field, value in self.__dict__.items():
39
- setattr(S,field,value)
40
- return S
41
-
42
- def delfromList(self,ind_del):
43
- for k in range(len(ind_del)-1,-1,-1):
44
- for _,f in self.__dict__.items():
45
- del f[ind_del[k]]
46
-
47
- def extractPinfo(self,k):
48
- S=patternInfoList()
49
- for field, value in self.__dict__.items():
50
- setattr(S,field,value[k])
51
- return S
52
-
53
- def isDifferentFrom(self,v,exceptions,*args):
54
- Flag=False
55
- for f, _ in self.__dict__.items():
56
- if f in exceptions: continue
57
- a=getattr(self,f)
58
- b=getattr(v,f)
59
- if a!=b:
60
- Flag=True
61
- break
62
- return Flag
63
-
64
- class patternInfoVar(patternInfoList):
65
- def __init__(self):
66
- super().__init__()
67
- for field, f in self.__dict__.items():
68
- if field in ('pattern','ext','root',):
69
- setattr(self,field,'')
70
- elif field == 'pa':
71
- setattr(self,field,[[]])
72
- else:
73
- setattr(self,field,0)
74
- self.target=''
75
- self.split_target=''
76
- self.jdig=''
77
- self.nab=0
78
-
79
- #*************************************************** Analyse Path
80
- def analysePath(path,*args):
81
- if len(args)==0:
82
- FlagStop=[False]
83
- else:
84
- FlagStop=args[0]
85
- path=myStandardRoot(path) #maybe useless
86
- Pinfo=patternInfoList()
87
- myNone=patternInfoVar()
88
-
89
- """
90
- cont=0
91
- while not FlagStop[0] and cont<Ncont:
92
- timesleep(.01)
93
- cont+=1
94
- """
95
- files=findFiles_sorted(path+"*.*") # needed to use the recompiled reg expressions
96
- if FlagStop[0]: return myNone
97
- icont=-1
98
- for file in files:
99
- icont+=1
100
- flag_done=False
101
- basename=os.path.basename(file)
102
- if len(Pinfo.pa): # this check is done before the ext check since it is faster?!
103
- Pinfo,flag_done=checkPinfo(basename,Pinfo,flag_done,FlagStop)
104
- if not flag_done:
105
- if FlagStop[0]: return myNone
106
- if any(file.endswith(ex) for ex in supported_exts):
107
- target, ext=os.path.splitext(os.path.basename(file))
108
- Pinfo_file=getPatternInfo(target, ext, FlagStop)
109
- if FlagStop[0]: return myNone
110
- if len(Pinfo_file.pa):
111
- for ii in range(icont):
112
- file_prev=files[ii]
113
- basename=os.path.basename(file_prev)
114
- Pinfo_file,flag_done=checkPinfo(basename,Pinfo_file,flag_done,FlagStop)
115
- Pinfo=Pinfo_file.addto(Pinfo)
116
- if len(Pinfo.pa): # needed in any case
117
- ind_del=[] # delete all patterns corresponding to single images
118
- for k in range(0,len(Pinfo.nimg_tot)):
119
- if FlagStop[0]: return myNone
120
- Pinfo.nimg[k]=Pinfo.ind_fin[k]-Pinfo.ind_in[k]+1
121
- if (Pinfo.nimg_tot[k]<2 and len(Pinfo.fra[k])<2) or len(Pinfo.fra[k])==1:
122
- ind_del.append(k)
123
- if FlagStop[0]: return myNone
124
- Pinfo.delfromList(ind_del)
125
- for j in range(len(Pinfo.fra)):
126
- if FlagStop[0]: return myNone
127
- if len(Pinfo.fra[j])>1:
128
- Pinfo.nfra[j]=len(Pinfo.fra[j])
129
- root=[]
130
- for k in range(len(Pinfo.fra[j])):
131
- if FlagStop[0]: return myNone
132
- root.append(Pinfo.root[j].replace('@',Pinfo.fra[j][k]))
133
- Pinfo.root[j]=" ; ".join(root)
134
- else:
135
- if Pinfo.nimg_tot[j]: Pinfo.nfra[j]=1
136
- return Pinfo
137
-
138
-
139
- def checkPinfo(basename,Pinfo,flag_done,*args):
140
- if len(args)==0:
141
- FlagStop=[False]
142
- else:
143
- FlagStop=args[0]
144
- myNone=None
145
- for k in range(0,len(Pinfo.pa)):
146
- if FlagStop[0]: return myNone
147
- if Pinfo.pa[k].match(basename):
148
- Pinfo.nimg_tot[k] +=1
149
- indf=int(basename[Pinfo.n[k]+1:Pinfo.n[k]+1+Pinfo.ndig[k]])
150
- Pinfo.ind_in[k]=min(Pinfo.ind_in[k],indf)
151
- Pinfo.ind_fin[k]=max(Pinfo.ind_fin[k],indf)
152
- if Pinfo.fra[k]!='':
153
- if FlagStop[0]: return myNone
154
- newframe=basename[Pinfo.nab[k]]
155
- if newframe.isalpha() and not (newframe in Pinfo.fra[k]):
156
- Pinfo.fra[k]=Pinfo.fra[k]+newframe
157
- flag_done=True
158
- return Pinfo, flag_done
159
-
160
- def getPatternInfo(target,ext,*args):
161
- if len(args)==0:
162
- FlagStop=[False]
163
- else:
164
- FlagStop=args[0]
165
- S=patternInfoList()
166
-
167
- if not target=='': # no image file was found in the path
168
- # the pattern is the name of the image file without extension and with a star *
169
- # in the place of the sequential image number; in general it is different between
170
- # frame a and b
171
- split_target=re.split('(\d+)', target)
172
- jdig=0
173
- for j in range(0,len(split_target)):
174
- if FlagStop[0]: return None
175
- if len(split_target[j]):
176
- if split_target[j][0].isdigit():
177
- s=patternInfoVar()
178
- s.target=target
179
- s.split_target=split_target
180
- s.ext=ext
181
- s.jdig=j
182
- s.n=-1
183
- s.nab=-1
184
- s.ndig=len(s.split_target[s.jdig])
185
- s.ind_in=int(s.split_target[s.jdig])
186
- s.ind_fin=int(s.split_target[s.jdig])
187
- s.nimg_tot=1
188
- s.nimg=1
189
- for k in range(0,s.jdig):
190
- s.n=s.n+len(s.split_target[k])
191
- sn=getPattern(s.duplicate(),FlagStop)
192
- if FlagStop[0]: return None
193
- S=sn.addto(S)
194
- del sn
195
-
196
- if s.target[s.n].isalpha():
197
- s.nab=s.n
198
- sn=getPattern(s.duplicate(),FlagStop)
199
- if FlagStop[0]: return None
200
- S=sn.addto(S)
201
- del sn
202
-
203
- m=s.n+s.ndig+1
204
- if len(s.target)>m:
205
- if s.target[m].isalpha():
206
- s.nab=s.n+2
207
- s.ndig=len(s.split_target[s.jdig])
208
- s=getPattern(s.duplicate(),FlagStop)
209
- if FlagStop[0]: return None
210
- S=s.addto(S)
211
-
212
- del s
213
- #s=patternInfo(split_target, jmax, pa, pab, root, flag_ab, pattern, pattern_b, n, m, nab, ext)
214
- return S
215
-
216
- def getPattern(s=patternInfoVar,*args):
217
- if len(args)==0:
218
- FlagStop=[False]
219
- else:
220
- FlagStop=args[0]
221
- target_star=s.split_target.copy()
222
- target_star[s.jdig]='*'
223
- pattern=target_star[0]
224
- for j in range(1,len(s.split_target)):
225
- pattern=pattern+target_star[j]
226
- if FlagStop[0]: return None
227
-
228
- if s.nab!=-1:
229
- pattern_list=list(pattern)
230
- s.fra=pattern_list[s.nab]
231
- pattern_list[s.nab]='@'
232
- s.pattern="".join(pattern_list)
233
- if s.nab>s.n:
234
- s.nab=s.nab+s.ndig-1
235
- else:
236
- s.fra=''
237
- s.pattern=pattern
238
- s.root=s.pattern+s.ext
239
- sdig="*{"+str(s.ndig)+"}"
240
- s.root=s.root.replace("*",sdig,1)
241
-
242
- if FlagStop[0]: return None
243
-
244
- s.pa=getpa(s,FlagStop)
245
- if FlagStop[0]: return None
246
- return s
247
-
248
- def getpa(s,*args):
249
- if len(args)==0:
250
- FlagStop=[False]
251
- else:
252
- FlagStop=args[0]
253
- sdig='\\d{'+str(s.ndig)+'}'
254
- if s.nab!=-1:
255
- if s.target[s.nab].islower():
256
- wdig='[a-z]'
257
- else:
258
- wdig='[A-Z]'
259
- else:
260
- wdig=''
261
- if FlagStop[0]: return None
262
- pattern_dig=s.pattern+s.ext
263
- pattern_dig=pattern_dig.replace('@',wdig)
264
- pattern_dig=pattern_dig.replace('*','.*')
265
- pattern_dig=pattern_dig.replace('.*',sdig,1)
266
- pa=re.compile(pattern_dig)
267
- return pa
268
-
269
- def getpaf(s,frame,*args):
270
- if len(args)==0:
271
- FlagStop=[False]
272
- else:
273
- FlagStop=args[0]
274
- sdig='\\d{'+str(s.ndig)+'}'
275
- if s.target[s.nab].islower():
276
- wdig=f'[{frame}]'
277
- else:
278
- wdig=f'[{frame}]'
279
- if FlagStop[0]: return None
280
- pattern_dig=s.pattern+s.ext
281
- pattern_dig=pattern_dig.replace('@',wdig)
282
- pattern_dig=pattern_dig.replace('*','.*')
283
- pattern_dig=pattern_dig.replace('.*',sdig,1)
284
- pa=re.compile(pattern_dig)
285
- return pa
286
-
287
- #*************************************************** Create List of Images
288
- def createListImages(path,pinfo=patternInfoList,flagTR=bool,*args):
289
- if len(args)==0:
290
- FlagStop=[False]
291
- else:
292
- FlagStop=args[0]
293
-
294
- """
295
- cont=0
296
- while not FlagStop[0] and cont<Ncont:
297
- timesleep(.01)
298
- cont+=1
299
- """
300
-
301
- roots=re.split(";",pinfo.root)
302
- lists_images=[]
303
- lists_eim=[]
304
- #lists_num=[]
305
- #lists_fra=[]
306
- orda=ord('a')-1
307
- for r in list(roots):
308
- if FlagStop[0]: return None
309
- orda+=1
310
- list_image=[]
311
- list_eim=[]
312
- #list_num=[]
313
- #list_fra=[]
314
- root=r.replace(" ","")
315
- sdig="%0" + "%d" % (pinfo.ndig) + "d"
316
- pattern_dig=re.sub('\*{\d+}',sdig,root,1)
317
- for i in range(pinfo.nimg):
318
- if FlagStop[0]: return None
319
- image_name=pattern_dig % (i+pinfo.ind_in)
320
- list_image.append(image_name)
321
- list_eim.append(os.path.exists(path+image_name))
322
- #list_num.append(i)
323
- #list_fra.append(chr(orda))
324
- lists_images.append(list_image)
325
- lists_eim.append(list_eim)
326
- #lists_num.append(list_num)
327
- #lists_fra.append(list_fra)
328
- del list_image, list_eim #, list_num, list_fra
329
-
330
- if FlagStop[0]: return None
331
- list_Image_Files,flagOdd=buildList(lists_images,flagTR,FlagStop)
332
- if FlagStop[0]: return None
333
- list_eim, _=buildList(lists_eim,flagTR,FlagStop)
334
- if FlagStop[0]: return None
335
- #list_num=buildList(lists_num,flagTR)
336
- #list_fra=buildList(lists_fra,flagTR)
337
-
338
- nimg_eff=int(len(list_Image_Files)/2)
339
- list_num=[num for num in range(nimg_eff)]
340
- if FlagStop[0]: return None
341
- list_num=interlace_lists([list_num,list_num],FlagStop)
342
- if FlagStop[0]: return None
343
- list_fra_a=['a' for num in range(nimg_eff)]
344
- if FlagStop[0]: return None
345
- list_fra_b=['b' for num in range(nimg_eff)]
346
- if FlagStop[0]: return None
347
- list_fra=interlace_lists([list_fra_a,list_fra_b],FlagStop)
348
- if FlagStop[0]: return None
349
-
350
-
351
- list_Image_numbers=[]
352
- list_Image_items=[]
353
- for k in range(nimg_eff*2):
354
- if FlagStop[0]: return None
355
- numberk=str(list_num[k]+imin_im_pair)+list_fra[k]+": "
356
- list_Image_numbers.append(numberk)
357
- itemk=list_Image_Files[k]
358
- if not list_eim[k]:
359
- itemk=itemk+" (⚠)"
360
- list_Image_items.append(itemk)
361
- nimg_eff=nimg_eff-1*flagOdd
362
- if flagOdd: list_eim[-1]=True
363
-
364
- #read image dimensions
365
- if len(list_eim):
366
- j=0
367
- while j<len(list_eim):
368
- if FlagStop[0]: return None
369
- if not list_eim[j]: j+=1
370
- else: break
371
- if FlagStop[0]: return None
372
- if j<len(list_eim):
373
- I=Image.open(path+list_Image_Files[j])
374
- w=I.width
375
- h=I.height
376
- else:
377
- w=h=0
378
- else:
379
- w=h=0
380
-
381
- results=[list_Image_Files, list_eim, list_Image_numbers, list_Image_items, nimg_eff, w, h, flagTR]
382
- return results
383
-
384
- def buildList(l,flagTR,*args):
385
- if len(args)==0:
386
- FlagStop=[False]
387
- else:
388
- FlagStop=args[0]
389
- nfra=len(l)
390
- if nfra>1:
391
- l=interlace_lists(l,FlagStop)
392
- else:
393
- l=l[0]
394
- if FlagStop[0]: return None
395
-
396
- flagOdd=len(l)%2
397
- if flagOdd: l.append('')
398
- l=[l[:-1],l[1:]]
399
- if not flagTR:
400
- if nfra>1:
401
- for lc in l:
402
- if FlagStop[0]: return None
403
- del lc[nfra-1::nfra]
404
- else:
405
- for lc in l:
406
- if FlagStop[0]: return None
407
- del lc[1::2]
408
-
409
- l=interlace_lists(l,FlagStop)
410
- if FlagStop[0]: return None
411
- return l,flagOdd
412
-
413
- def interlace_lists(l,*args):
414
- if len(args)==0:
415
- FlagStop=[False]
416
- else:
417
- FlagStop=args[0]
418
- nfra=len(l)
419
- nimg=len(l[0])
420
- lint= [None]*(nfra*nimg)
421
- if FlagStop[0]: return None
422
- for k in range(nfra):
423
- if FlagStop[0]: return None
424
- lint[k::nfra]=l[k]
425
- return lint
426
-
427
- #*************************************************** Add new pinfo from user input
428
- def analyseRoot(path,pattern,*args):
429
- if len(args)==0:
430
- FlagStop=[False]
431
- else:
432
- FlagStop=args[0]
433
- pinfo=patternInfoVar()
434
- myNone=patternInfoVar()
435
-
436
- roots=re.split(";",pattern)
437
- i=0
438
- flagat="@" in roots[i]
439
- while not flagat and i<len(roots)-1:
440
- i+=1
441
- flagat="@" in roots[i]
442
- break
443
- if flagat: roots=[roots[i]]
444
-
445
- flag_done=False
446
- ndig=None
447
- isLower=0
448
- for k in range(len(roots)):
449
- if FlagStop[0]: return myNone
450
- roots[k]=roots[k].replace(" ","")
451
- roots[k]=re.sub("\*+","*",roots[k])
452
- if ndig==None:
453
- astseq=re.findall("\*\{\d+\}",roots[k])
454
- if len(astseq):
455
- if k==0: ndig=int(re.findall("\{\d+\}",astseq[0])[0][1:-1])
456
- else:
457
- if k==0: ndig=0
458
- roots[k]=re.sub("\*\{\d+\}","*",roots[k])
459
- if FlagStop[0]: return myNone
460
- if pinfo.ext:
461
- if not pinfo.ext in roots[k]:
462
- roots[k]=roots[k]+"*"+pinfo.ext
463
- roots[k]=re.sub("\*+","*",roots[k])
464
- pa=getpaun(roots[k],ndig,isLower)
465
- else: pa=getpaun(roots[k],ndig,isLower)
466
- else: pa=getpaun(roots[k],ndig,isLower)
467
- files=findFiles_sorted(path+roots[k].replace('@','*')+"*") # needed to use the recompiled reg expressions
468
- if FlagStop[0]: return myNone
469
- for file in files:
470
- if FlagStop[0]: return myNone
471
- basename=os.path.basename(file)
472
- if not flag_done:
473
- if any(file.endswith(ex) for ex in supported_exts) and pa.match(basename)!=None:
474
- target, ext=os.path.splitext(basename)
475
- Pinfo=getPatternInfo(target, ext, FlagStop)
476
- root_eff=os.path.splitext(roots[k])[0]
477
- if root_eff in Pinfo.pattern:
478
- pinfo=Pinfo.extractPinfo(Pinfo.pattern.index(root_eff))
479
- roots[k]=re.sub("\*\{\d+\}","*",pinfo.root)
480
- ndig=pinfo.ndig
481
- pa=getpaun(roots[k],ndig,isLower)
482
- flag_done=True
483
- elif len(Pinfo.pattern):
484
- kp=np.argmax(np.asarray(Pinfo.nimg_tot))
485
- pinfo=Pinfo.extractPinfo(kp)
486
- roots[k]=re.sub("\*\{\d+\}","*",pinfo.root)
487
- ndig=pinfo.ndig
488
- pa=getpaun(roots[k],ndig,isLower)
489
- flag_done=True
490
- if flag_done and k==0 and not pinfo.ext in roots[k]:
491
- #if len(roots)==1 there is a @ and I cannot replace the pattern
492
- roots[k]=roots[k]+"*"+pinfo.ext
493
- roots[k]=re.sub("\*+","*",roots[k])
494
- pa=getpaun(roots[k],ndig,isLower)
495
- if flag_done and flagat:
496
- if basename[pinfo.nab].islower():
497
- isLower=1
498
- pa=getpaun(pattern,ndig,isLower)
499
- else:
500
- isLower=-1
501
- pa=getpaun(roots[k],ndig,isLower)
502
- else:
503
- if pa.match(basename):
504
- pinfo.nimg_tot +=1
505
- indf=int(basename[pinfo.n+1:pinfo.n+1+pinfo.ndig])
506
- pinfo.ind_in=min(pinfo.ind_in,indf)
507
- pinfo.ind_fin=max(pinfo.ind_fin,indf)
508
- if pinfo.fra!='':
509
- if FlagStop[0]: return myNone
510
- newframe=basename[pinfo.nab]
511
- if newframe.isalpha() and not (newframe in pinfo.fra):
512
- pinfo.fra=pinfo.fra+newframe
513
- if pinfo.nimg_tot>0:
514
- pinfo.nimg=pinfo.ind_fin-pinfo.ind_in+1
515
- if FlagStop[0]: return myNone
516
- if len(roots)==1:
517
- if flag_done:
518
- if len(pinfo.fra)>1:
519
- root=[]
520
- for k in range(len(pinfo.fra)):
521
- if FlagStop[0]: return myNone
522
- root.append(pinfo.root.replace('@',pinfo.fra[k]))
523
- pinfo.root=" ; ".join(root)
524
- else:
525
- root=[]
526
- for k in range(len(roots)):
527
- if FlagStop[0]: return myNone
528
- pinfo.fra=pinfo.fra+chr(97+k)
529
- sdig="*{"+str(pinfo.ndig)+"}"
530
- root.append(roots[k].replace('*',sdig,1))
531
- pinfo.root=" ; ".join(root)
532
- pinfo.pattern=pattern
533
- else:
534
- pinfo.nimg_tot=0
535
- pinfo.nimg=0
536
- pinfo.root=pattern
537
- pinfo.ndig=0
538
- return pinfo
539
-
540
- def getpaun(pattern,ndig,isLower): #getpa un=unknown number of digits and lower/uppercase
541
- if ndig:
542
- sdig='\\d{'+str(ndig)+'}[^0-9]*'
543
- else:
544
- sdig='\\d+'
545
- if isLower==0:
546
- wdig='[a-zA-Z]'
547
- elif isLower>0:
548
- wdig='[a-z]'
549
- elif isLower<0:
550
- wdig='[A-Z]'
551
- pattern_dig=pattern+'**'
552
- pattern_dig=pattern_dig.replace('@',wdig)
553
- pattern_dig=pattern_dig.replace('*','.*')
554
- pattern_dig=pattern_dig.replace('.*',sdig,1)
555
- pa=re.compile(pattern_dig)
556
- return pa
557
-
558
- #*************************************************** TESTING
559
- if __name__ == "__main__":
560
- working_fold=basefold
561
- working_fold='C:/desk/PIV_Img/swirler_png/'
562
- #working_fold='/Users/gerardo/Desktop/img/img1/'
563
- flagTR=False
564
-
565
- print('*'*50)
566
- Pinfo=analysePath(working_fold)
567
- print(f'analysePath("{working_fold}"):')
568
- print(f' root={Pinfo.root}')
569
- print(f' nimg={Pinfo.nimg}')
570
- print(f' nimg_tot={Pinfo.nimg_tot}')
571
- print(f' ind_in={Pinfo.ind_in}')
572
- print(f' ind_in={Pinfo.ind_fin}')
573
-
574
- if Pinfo.nimg_tot:
575
- k=np.argmax(np.asarray(Pinfo.nimg_tot))
576
- pinfo=Pinfo.extractPinfo(k)
577
- else:
578
- pinfo=patternInfoVar()
579
- pinfo.fra==''
580
- results=createListImages(working_fold,pinfo,flagTR)
581
- print(f'root with largest # of images=\n root={pinfo.root}')
582
- for num,im in zip(results[2], results[3]):
583
- print(f' {num+im}')
584
-
585
-
586
- root='img_cam0_b*; img_cam0_a*'
587
- print('*'*50)
588
- print(f'analyseRoot("{working_fold}","{root}"):')
589
- pinfo=analyseRoot(working_fold,root)
590
- print(f'root={pinfo.root}')
591
- print(f'nimg={pinfo.nimg}')
592
- print(f'nimg_tot={pinfo.nimg_tot}')
593
- print(f'pattern={pinfo.pattern}')
594
- results=createListImages(working_fold,pinfo,flagTR)
595
- for num,im in zip(results[2], results[3]):
596
- print(f' {num+im}')
597
-
598
- print('\n\nTHE END')