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.
- PaIRS_UniNa/Calibration_Tab.py +331 -0
- PaIRS_UniNa/Changes.txt +134 -2
- PaIRS_UniNa/Custom_Top.py +299 -299
- PaIRS_UniNa/Explorer.py +3136 -0
- PaIRS_UniNa/FolderLoop.py +562 -0
- PaIRS_UniNa/Input_Tab.py +831 -0
- PaIRS_UniNa/Input_Tab_CalVi.py +786 -0
- PaIRS_UniNa/Input_Tab_tools.py +3025 -0
- PaIRS_UniNa/Log_Tab.py +57 -14
- PaIRS_UniNa/Output_Tab.py +922 -0
- PaIRS_UniNa/PaIRS_PIV.py +111 -18
- PaIRS_UniNa/PaIRS_pypacks.py +698 -140
- PaIRS_UniNa/Process_Tab.py +1221 -1402
- PaIRS_UniNa/Process_Tab_CalVi.py +137 -262
- PaIRS_UniNa/Process_Tab_Disp.py +163 -0
- PaIRS_UniNa/Process_Tab_Min.py +120 -0
- PaIRS_UniNa/Saving_tools.py +296 -0
- PaIRS_UniNa/TabTools.py +863 -543
- PaIRS_UniNa/Vis_Tab.py +1898 -1315
- PaIRS_UniNa/Vis_Tab_CalVi.py +484 -356
- PaIRS_UniNa/Whatsnew.py +59 -10
- PaIRS_UniNa/_PaIRS_PIV.pyd +0 -0
- PaIRS_UniNa/__init__.py +4 -3
- PaIRS_UniNa/addwidgets_ps.py +326 -56
- PaIRS_UniNa/calib.py +19 -12
- PaIRS_UniNa/calibView.py +48 -25
- PaIRS_UniNa/gPaIRS.py +3902 -3461
- PaIRS_UniNa/gPalette.py +189 -170
- PaIRS_UniNa/icons/align_all.png +0 -0
- PaIRS_UniNa/icons/announcement.png +0 -0
- PaIRS_UniNa/icons/automatic_levels_off.png +0 -0
- PaIRS_UniNa/icons/automatic_levels_on.png +0 -0
- PaIRS_UniNa/icons/automatic_off.png +0 -0
- PaIRS_UniNa/icons/automatic_on.png +0 -0
- PaIRS_UniNa/icons/automatic_size_off.png +0 -0
- PaIRS_UniNa/icons/automatic_size_on.png +0 -0
- PaIRS_UniNa/icons/bin_off.png +0 -0
- PaIRS_UniNa/icons/bin_on.png +0 -0
- PaIRS_UniNa/icons/brush_cursor.png +0 -0
- PaIRS_UniNa/icons/bugfix.png +0 -0
- PaIRS_UniNa/icons/cal_proc.png +0 -0
- PaIRS_UniNa/icons/cal_proc_off.png +0 -0
- PaIRS_UniNa/icons/cal_step.png +0 -0
- PaIRS_UniNa/icons/cal_step_off.png +0 -0
- PaIRS_UniNa/icons/calibration_logo.png +0 -0
- PaIRS_UniNa/icons/change_folder.png +0 -0
- PaIRS_UniNa/icons/change_folder_off.png +0 -0
- PaIRS_UniNa/icons/close_all.png +0 -0
- PaIRS_UniNa/icons/close_workspace.png +0 -0
- PaIRS_UniNa/icons/colormap.png +0 -0
- PaIRS_UniNa/icons/colormaps/Accent.png +0 -0
- PaIRS_UniNa/icons/colormaps/BrBG.png +0 -0
- PaIRS_UniNa/icons/colormaps/Dark2.png +0 -0
- PaIRS_UniNa/icons/colormaps/PRGn.png +0 -0
- PaIRS_UniNa/icons/colormaps/Paired.png +0 -0
- PaIRS_UniNa/icons/colormaps/Pastel1.png +0 -0
- PaIRS_UniNa/icons/colormaps/Pastel2.png +0 -0
- PaIRS_UniNa/icons/colormaps/PiYG.png +0 -0
- PaIRS_UniNa/icons/colormaps/PuOr.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdBu.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdGy.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdYlBu.png +0 -0
- PaIRS_UniNa/icons/colormaps/RdYlGn.png +0 -0
- PaIRS_UniNa/icons/colormaps/Set1.png +0 -0
- PaIRS_UniNa/icons/colormaps/Set2.png +0 -0
- PaIRS_UniNa/icons/colormaps/Set3.png +0 -0
- PaIRS_UniNa/icons/colormaps/Spectral.png +0 -0
- PaIRS_UniNa/icons/colormaps/Wistia.png +0 -0
- PaIRS_UniNa/icons/colormaps/afmhot.png +0 -0
- PaIRS_UniNa/icons/colormaps/autumn.png +0 -0
- PaIRS_UniNa/icons/colormaps/binary.png +0 -0
- PaIRS_UniNa/icons/colormaps/blackVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/blueVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/bone.png +0 -0
- PaIRS_UniNa/icons/colormaps/brg.png +0 -0
- PaIRS_UniNa/icons/colormaps/bwr.png +0 -0
- PaIRS_UniNa/icons/colormaps/cividis.png +0 -0
- PaIRS_UniNa/icons/colormaps/cool.png +0 -0
- PaIRS_UniNa/icons/colormaps/coolwarm.png +0 -0
- PaIRS_UniNa/icons/colormaps/copper.png +0 -0
- PaIRS_UniNa/icons/colormaps/cubehelix.png +0 -0
- PaIRS_UniNa/icons/colormaps/cyanVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/flag.png +0 -0
- PaIRS_UniNa/icons/colormaps/gist_heat.png +0 -0
- PaIRS_UniNa/icons/colormaps/gray.png +0 -0
- PaIRS_UniNa/icons/colormaps/greenVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/hot.png +0 -0
- PaIRS_UniNa/icons/colormaps/hsv.png +0 -0
- PaIRS_UniNa/icons/colormaps/inferno.png +0 -0
- PaIRS_UniNa/icons/colormaps/jet.png +0 -0
- PaIRS_UniNa/icons/colormaps/magentaVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/magma.png +0 -0
- PaIRS_UniNa/icons/colormaps/ocean.png +0 -0
- PaIRS_UniNa/icons/colormaps/pink.png +0 -0
- PaIRS_UniNa/icons/colormaps/plasma.png +0 -0
- PaIRS_UniNa/icons/colormaps/prism.png +0 -0
- PaIRS_UniNa/icons/colormaps/rainbow.png +0 -0
- PaIRS_UniNa/icons/colormaps/redVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/seismic.png +0 -0
- PaIRS_UniNa/icons/colormaps/spring.png +0 -0
- PaIRS_UniNa/icons/colormaps/summer.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab10.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab20.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab20b.png +0 -0
- PaIRS_UniNa/icons/colormaps/tab20c.png +0 -0
- PaIRS_UniNa/icons/colormaps/terrain.png +0 -0
- PaIRS_UniNa/icons/colormaps/twilight.png +0 -0
- PaIRS_UniNa/icons/colormaps/viridis.png +0 -0
- PaIRS_UniNa/icons/colormaps/whiteVector.png +0 -0
- PaIRS_UniNa/icons/colormaps/winter.png +0 -0
- PaIRS_UniNa/icons/colormaps/yellowVector.png +0 -0
- PaIRS_UniNa/icons/common_region.png +0 -0
- PaIRS_UniNa/icons/common_region_off.png +0 -0
- PaIRS_UniNa/icons/completed.png +0 -0
- PaIRS_UniNa/icons/contourf_off.png +0 -0
- PaIRS_UniNa/icons/contourf_on.png +0 -0
- PaIRS_UniNa/icons/copy.png +0 -0
- PaIRS_UniNa/icons/copy_process.png +0 -0
- PaIRS_UniNa/icons/copy_process_off.png +0 -0
- PaIRS_UniNa/icons/cut.png +0 -0
- PaIRS_UniNa/icons/cut_warnings.png +0 -0
- PaIRS_UniNa/icons/darkmode.png +0 -0
- PaIRS_UniNa/icons/disp_step.png +0 -0
- PaIRS_UniNa/icons/disp_step_off.png +0 -0
- PaIRS_UniNa/icons/edit_list.png +0 -0
- PaIRS_UniNa/icons/example_list.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS_beta.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS_download_warning.png +0 -0
- PaIRS_UniNa/icons/flip_y_off.png +0 -0
- PaIRS_UniNa/icons/flip_y_on.png +0 -0
- PaIRS_UniNa/icons/folder_loop_cleanup.png +0 -0
- PaIRS_UniNa/icons/folder_loop_cleanup_off.png +0 -0
- PaIRS_UniNa/icons/gear.gif +0 -0
- PaIRS_UniNa/icons/gear.png +0 -0
- PaIRS_UniNa/icons/import_set.png +0 -0
- PaIRS_UniNa/icons/information.png +0 -0
- PaIRS_UniNa/icons/input_logo.png +0 -0
- PaIRS_UniNa/icons/issue.png +0 -0
- PaIRS_UniNa/icons/laser_NTR.png +0 -0
- PaIRS_UniNa/icons/laser_TR_double.png +0 -0
- PaIRS_UniNa/icons/laser_TR_single.png +0 -0
- PaIRS_UniNa/icons/link.png +0 -0
- PaIRS_UniNa/icons/linked.png +0 -0
- PaIRS_UniNa/icons/log_logo.png +0 -0
- PaIRS_UniNa/icons/logo_opaco.png +0 -0
- PaIRS_UniNa/icons/measure.png +0 -0
- PaIRS_UniNa/icons/measure_off.png +0 -0
- PaIRS_UniNa/icons/min_proc.png +0 -0
- PaIRS_UniNa/icons/min_proc_off.png +0 -0
- PaIRS_UniNa/icons/min_step.png +0 -0
- PaIRS_UniNa/icons/min_step_off.png +0 -0
- PaIRS_UniNa/icons/new_workspace.png +0 -0
- PaIRS_UniNa/icons/open_image.png +0 -0
- PaIRS_UniNa/icons/open_new_window.png +0 -0
- PaIRS_UniNa/icons/open_result.png +0 -0
- PaIRS_UniNa/icons/open_workspace.png +0 -0
- PaIRS_UniNa/icons/output_logo.png +0 -0
- PaIRS_UniNa/icons/paste_above.png +0 -0
- PaIRS_UniNa/icons/paste_below.png +0 -0
- PaIRS_UniNa/icons/paused.png +0 -0
- PaIRS_UniNa/icons/piv_proc.png +0 -0
- PaIRS_UniNa/icons/piv_proc_off.png +0 -0
- PaIRS_UniNa/icons/piv_step.png +0 -0
- PaIRS_UniNa/icons/piv_step_off.png +0 -0
- PaIRS_UniNa/icons/process_logo.png +0 -0
- PaIRS_UniNa/icons/process_loop.png +0 -0
- PaIRS_UniNa/icons/project.png +0 -0
- PaIRS_UniNa/icons/pylog.png +0 -0
- PaIRS_UniNa/icons/python_warning.png +0 -0
- PaIRS_UniNa/icons/queue.png +0 -0
- PaIRS_UniNa/icons/read.png +0 -0
- PaIRS_UniNa/icons/read_list.png +0 -0
- PaIRS_UniNa/icons/reset.png +0 -0
- PaIRS_UniNa/icons/reset_levels.png +0 -0
- PaIRS_UniNa/icons/restore_undo.png +0 -0
- PaIRS_UniNa/icons/running.gif +0 -0
- PaIRS_UniNa/icons/running.png +0 -0
- PaIRS_UniNa/icons/running_warn.png +0 -0
- PaIRS_UniNa/icons/save_and_stop.png +0 -0
- PaIRS_UniNa/icons/save_cfg.png +0 -0
- PaIRS_UniNa/icons/saveas_workspace.png +0 -0
- PaIRS_UniNa/icons/scale_all.png +0 -0
- PaIRS_UniNa/icons/scale_down.png +0 -0
- PaIRS_UniNa/icons/scale_up.png +0 -0
- PaIRS_UniNa/icons/scan_list.png +0 -0
- PaIRS_UniNa/icons/scan_path.png +0 -0
- PaIRS_UniNa/icons/scan_path_loop.png +0 -0
- PaIRS_UniNa/icons/scan_path_loop_off.png +0 -0
- PaIRS_UniNa/icons/search.png +0 -0
- PaIRS_UniNa/icons/showIW_off.png +0 -0
- PaIRS_UniNa/icons/showIW_on.png +0 -0
- PaIRS_UniNa/icons/show_all.png +0 -0
- PaIRS_UniNa/icons/sort.png +0 -0
- PaIRS_UniNa/icons/sort_reversed.png +0 -0
- PaIRS_UniNa/icons/spiv_proc.png +0 -0
- PaIRS_UniNa/icons/spiv_proc_off.png +0 -0
- PaIRS_UniNa/icons/star.png +0 -0
- PaIRS_UniNa/icons/step_inheritance.png +0 -0
- PaIRS_UniNa/icons/subMIN_off.png +0 -0
- PaIRS_UniNa/icons/subMIN_on.png +0 -0
- PaIRS_UniNa/icons/unedited.png +0 -0
- PaIRS_UniNa/icons/uninitialized.png +0 -0
- PaIRS_UniNa/icons/unlink.png +0 -0
- PaIRS_UniNa/icons/unwrap_items.png +0 -0
- PaIRS_UniNa/icons/vectorColor.png +0 -0
- PaIRS_UniNa/icons/view.png +0 -0
- PaIRS_UniNa/icons/view_off.png +0 -0
- PaIRS_UniNa/icons/vis_logo.png +0 -0
- PaIRS_UniNa/icons/warning_circle.png +0 -0
- PaIRS_UniNa/icons/window.png +0 -0
- PaIRS_UniNa/icons/workspace.png +0 -0
- PaIRS_UniNa/icons/wrap_items.png +0 -0
- PaIRS_UniNa/icons/write_list.png +0 -0
- PaIRS_UniNa/listLib.py +303 -0
- PaIRS_UniNa/mtfPIV.py +8 -8
- PaIRS_UniNa/parForMulti.py +7 -5
- PaIRS_UniNa/parForWorkers.py +370 -31
- PaIRS_UniNa/pivParFor.py +233 -229
- PaIRS_UniNa/plt_util.py +141 -141
- PaIRS_UniNa/preProcParFor.py +153 -148
- PaIRS_UniNa/procTools.py +631 -178
- PaIRS_UniNa/readcfg.py +31 -1
- PaIRS_UniNa/rqrdpckgs.txt +9 -0
- PaIRS_UniNa/stereoPivParFor.py +227 -0
- PaIRS_UniNa/tAVarie.py +215 -215
- PaIRS_UniNa/tabSplitter.py +612 -0
- PaIRS_UniNa/ui_Calibration_Tab.py +545 -0
- PaIRS_UniNa/ui_Custom_Top.py +5 -5
- PaIRS_UniNa/ui_Input_Tab.py +1101 -0
- PaIRS_UniNa/{ui_Import_Tab_CalVi.py → ui_Input_Tab_CalVi.py} +1282 -1275
- PaIRS_UniNa/ui_Log_Tab.py +262 -257
- PaIRS_UniNa/{ui_Export_Tab.py → ui_Output_Tab.py} +2361 -1778
- PaIRS_UniNa/ui_Process_Tab.py +3809 -3758
- PaIRS_UniNa/ui_Process_Tab_CalVi.py +1547 -1546
- PaIRS_UniNa/ui_Process_Tab_Disp.py +1141 -0
- PaIRS_UniNa/ui_Process_Tab_Min.py +437 -0
- PaIRS_UniNa/ui_Vis_Tab.py +1626 -1208
- PaIRS_UniNa/ui_Vis_Tab_CalVi.py +1249 -1249
- PaIRS_UniNa/ui_Whatsnew.py +131 -131
- PaIRS_UniNa/ui_gPairs.py +876 -950
- PaIRS_UniNa/ui_infoPaIRS.py +550 -425
- PaIRS_UniNa/whatsnew.txt +6 -4
- {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/METADATA +69 -51
- pairs_unina-0.2.8.dist-info/RECORD +329 -0
- {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/WHEEL +1 -1
- PaIRS_UniNa/CalVi.py +0 -18
- PaIRS_UniNa/Export_Tab.py +0 -574
- PaIRS_UniNa/Import_Tab.py +0 -657
- PaIRS_UniNa/Import_Tab_CalVi.py +0 -861
- PaIRS_UniNa/Import_Tab_tools.py +0 -598
- PaIRS_UniNa/Tree_Tab.py +0 -543
- PaIRS_UniNa/gCalVi.py +0 -2024
- PaIRS_UniNa/icons/add.png +0 -0
- PaIRS_UniNa/icons/cancelled.png +0 -0
- PaIRS_UniNa/icons/chain.png +0 -0
- PaIRS_UniNa/icons/chain_broken.png +0 -0
- PaIRS_UniNa/icons/default_sizes.png +0 -0
- PaIRS_UniNa/icons/dock_tabs.png +0 -0
- PaIRS_UniNa/icons/done.png +0 -0
- PaIRS_UniNa/icons/down_arrow.png +0 -0
- PaIRS_UniNa/icons/export_logo.png +0 -0
- PaIRS_UniNa/icons/fast_delete.png +0 -0
- PaIRS_UniNa/icons/flip_y.png +0 -0
- PaIRS_UniNa/icons/ganci.png +0 -0
- PaIRS_UniNa/icons/import_blue.png +0 -0
- PaIRS_UniNa/icons/import_logo.png +0 -0
- PaIRS_UniNa/icons/missing.png +0 -0
- PaIRS_UniNa/icons/process_icon.png +0 -0
- PaIRS_UniNa/icons/processing.png +0 -0
- PaIRS_UniNa/icons/restart.png +0 -0
- PaIRS_UniNa/icons/right_arrow.png +0 -0
- PaIRS_UniNa/icons/run_piv.png +0 -0
- PaIRS_UniNa/icons/terminal.png +0 -0
- PaIRS_UniNa/icons/undock_tabs.png +0 -0
- PaIRS_UniNa/icons/vect_field.png +0 -0
- PaIRS_UniNa/icons/w0.png +0 -0
- PaIRS_UniNa/icons/w1.png +0 -0
- PaIRS_UniNa/icons/w2.png +0 -0
- PaIRS_UniNa/icons/w3.png +0 -0
- PaIRS_UniNa/icons/w4.png +0 -0
- PaIRS_UniNa/icons/w5.png +0 -0
- PaIRS_UniNa/run_CalVi.py +0 -14
- PaIRS_UniNa/run_gcalvi.py +0 -5
- PaIRS_UniNa/ui_Import_Tab.py +0 -1077
- PaIRS_UniNa/ui_Tree_Tab.py +0 -684
- PaIRS_UniNa/ui_gCalVi.py +0 -640
- PaIRS_UniNa/ui_infoCalVi.py +0 -428
- PaIRS_UniNa-0.1.13.dist-info/LICENSE +0 -19
- PaIRS_UniNa-0.1.13.dist-info/RECORD +0 -174
- /PaIRS_UniNa/icons/{clean_queue.png → clean.png} +0 -0
- /PaIRS_UniNa/icons/{waiting_c.png → sandglass.png} +0 -0
- {PaIRS_UniNa-0.1.13.dist-info → pairs_unina-0.2.8.dist-info}/top_level.txt +0 -0
PaIRS_UniNa/Import_Tab.py
DELETED
|
@@ -1,657 +0,0 @@
|
|
|
1
|
-
from .ui_Import_Tab import*
|
|
2
|
-
from .Import_Tab_tools import*
|
|
3
|
-
from .TabTools import*
|
|
4
|
-
|
|
5
|
-
class INPpar(TABpar):
|
|
6
|
-
def __init__(self):
|
|
7
|
-
self.setup()
|
|
8
|
-
super().__init__()
|
|
9
|
-
self.name='INPpar'
|
|
10
|
-
self.surname='INPUT_Tab'
|
|
11
|
-
self.unchecked_fields+=['FlagValidPath','FlagValidRoot','selected']
|
|
12
|
-
|
|
13
|
-
def setup(self):
|
|
14
|
-
self.FlagValidPath = 0
|
|
15
|
-
self.path = ''
|
|
16
|
-
self.FlagValidRoot = 0
|
|
17
|
-
self.root = ''
|
|
18
|
-
self.FlagUpdating = 0
|
|
19
|
-
self.Pinfo = patternInfoList()
|
|
20
|
-
self.pinfo = patternInfoVar()
|
|
21
|
-
self.npairs = 0
|
|
22
|
-
self.nimg_eff = 0
|
|
23
|
-
self.nspa_eff = 0
|
|
24
|
-
self.range_from = 0
|
|
25
|
-
self.range_to = 0
|
|
26
|
-
self.selected = imin_im_pair
|
|
27
|
-
self.flag_TR = False
|
|
28
|
-
self.flag_min = True
|
|
29
|
-
self.x = 0
|
|
30
|
-
self.y = 0
|
|
31
|
-
self.w = 1
|
|
32
|
-
self.h = 1
|
|
33
|
-
self.W = 1
|
|
34
|
-
self.H = 1
|
|
35
|
-
self.list_Image_Files=[]
|
|
36
|
-
self.list_eim=[]
|
|
37
|
-
self.list_Image_numbers=[]
|
|
38
|
-
self.list_items=[]
|
|
39
|
-
self.list_ind_items=[]
|
|
40
|
-
self.pathCompleter=basefold_DEBUGOptions
|
|
41
|
-
|
|
42
|
-
class Import_Tab(gPaIRS_Tab):
|
|
43
|
-
class Import_Tab_Signals(gPaIRS_Tab.Tab_Signals):
|
|
44
|
-
set_Image_List=Signal()
|
|
45
|
-
analysePath_signal=Signal(patternInfoList,str,int)
|
|
46
|
-
createListImages_signal=Signal(bool,list,int)
|
|
47
|
-
def __init__(self, parent):
|
|
48
|
-
super().__init__(parent)
|
|
49
|
-
self.analysePath_signal.connect(parent.selectRootInPath)
|
|
50
|
-
self.createListImages_signal.connect(parent.setInfoImages)
|
|
51
|
-
|
|
52
|
-
def __init__(self,*args):
|
|
53
|
-
parent=None
|
|
54
|
-
flagInit=True
|
|
55
|
-
if len(args): parent=args[0]
|
|
56
|
-
if len(args)>1: flagInit=args[1]
|
|
57
|
-
super().__init__(parent,Ui_ImportTab,INPpar)
|
|
58
|
-
self.signals=self.Import_Tab_Signals(self)
|
|
59
|
-
|
|
60
|
-
#------------------------------------- Graphical interface: widgets
|
|
61
|
-
self.ui: Ui_ImportTab
|
|
62
|
-
ui=self.ui
|
|
63
|
-
ui.w_range_frame.hide()
|
|
64
|
-
ui.spin_range_from.addwid=[ui.spin_selected]
|
|
65
|
-
ui.spin_range_to.addwid=[ui.spin_selected]
|
|
66
|
-
ui.spin_x.addwid=[ui.spin_w]
|
|
67
|
-
ui.spin_y.addwid=[ui.spin_h]
|
|
68
|
-
|
|
69
|
-
self.setupWid() #---------------- IMPORTANT
|
|
70
|
-
self.ui.list_images.clear()
|
|
71
|
-
|
|
72
|
-
#------------------------------------- Graphical interface: miscellanea
|
|
73
|
-
self.mapx = QPixmap(''+ icons_path +'redx.png')
|
|
74
|
-
self.mapv = QPixmap(''+ icons_path +'greenv.png')
|
|
75
|
-
self.mapw = QPixmap(''+ icons_path +'waiting_c.png')
|
|
76
|
-
self.Lab_warning=QPixmap(u""+ icons_path +"warning.png")
|
|
77
|
-
|
|
78
|
-
self.list_Path_Root=["edit_path","button_path","edit_root","button_import"]
|
|
79
|
-
self.list_Spins=["spin_range_from","spin_range_to","spin_selected","spin_x","spin_y","spin_w","spin_h"]
|
|
80
|
-
self.list_Image_Opt=["check_TR_sequence","button_resize"]
|
|
81
|
-
self.list_List_Images=["list_images"]
|
|
82
|
-
self.list_All=self.list_Path_Root[:]+self.list_Spins[:]+self.list_Image_Opt[:]+self.list_List_Images[:]
|
|
83
|
-
self.spin_fields=("range_from","range_to","selected","x","y","w","h")
|
|
84
|
-
self.TR_min_fields=("flag_TR","flag_min")
|
|
85
|
-
|
|
86
|
-
self.icon_play=QIcon()
|
|
87
|
-
self.icon_play.addFile(u""+ icons_path +"play.png", QSize(), QIcon.Normal, QIcon.Off)
|
|
88
|
-
self.icon_pause=QIcon()
|
|
89
|
-
self.icon_pause.addFile(u""+ icons_path +"pause.png", QSize(), QIcon.Normal, QIcon.Off)
|
|
90
|
-
self.icon_done=QIcon()
|
|
91
|
-
self.icon_done.addFile(u""+ icons_path +"done.png", QSize(), QIcon.Normal, QIcon.Off)
|
|
92
|
-
self.edit_path_label=QPixmap()
|
|
93
|
-
self.edit_root_label=QPixmap()
|
|
94
|
-
|
|
95
|
-
#------------------------------------- Declaration of parameters
|
|
96
|
-
self.INPpar_base=INPpar()
|
|
97
|
-
self.INPpar:INPpar=self.TABpar
|
|
98
|
-
self.INPpar_old:INPpar=self.TABpar_old
|
|
99
|
-
self.defineSetTABpar(self.setINPpar)
|
|
100
|
-
|
|
101
|
-
#------------------------------------- Callbacks
|
|
102
|
-
self.setupCallbacks()
|
|
103
|
-
self.FlagSettingPar=False
|
|
104
|
-
|
|
105
|
-
#------------------------------------- Initializing
|
|
106
|
-
if flagInit:
|
|
107
|
-
self.initialize()
|
|
108
|
-
|
|
109
|
-
#self.ParPointer.w=self.ParPointer.W=infoImages[5]
|
|
110
|
-
#self.ParPointer.h=self.ParPointer.H=infoImages[6]
|
|
111
|
-
|
|
112
|
-
def initialize(self):
|
|
113
|
-
pri.Info.yellow(f'{"*"*20} INPUT initialization {"*"*20}')
|
|
114
|
-
from .PaIRS_pypacks import basefold
|
|
115
|
-
self.ui.edit_path.setFocus()
|
|
116
|
-
self.ui.edit_path.setText(basefold)
|
|
117
|
-
self.edit_path_action()
|
|
118
|
-
INPpar_prev=self.TABpar_prev[0][0][0]
|
|
119
|
-
self.getPinfoFromPath(INPpar_prev,[basefold,''])
|
|
120
|
-
self.setTABpar_prev(0,0,0,True) #with bridge
|
|
121
|
-
|
|
122
|
-
def setupCallbacks(self):
|
|
123
|
-
#Callbacks
|
|
124
|
-
self.ui.button_data.clicked.connect(lambda: downloadExampleData(self,'https://www.pairs.unina.it/web/PIV_data.zip'))
|
|
125
|
-
|
|
126
|
-
self.ui.edit_path.textChanged.connect(self.edit_path_changing)
|
|
127
|
-
self.ui.edit_path.editingFinished.connect(self.edit_path_finished)
|
|
128
|
-
self.edit_path_callback=self.addParWrapper(self.edit_path_action,'Input folder path')
|
|
129
|
-
self.ui.edit_path.returnPressed.connect(self.edit_path_callback)
|
|
130
|
-
self.ui.button_path.clicked.connect(\
|
|
131
|
-
self.addParWrapper(self.button_path_callback,'Input folder path'))
|
|
132
|
-
self.ui.edit_path.FunSetCompleterList=self.setPathCompleter
|
|
133
|
-
|
|
134
|
-
self.ui.edit_root.textChanged.connect(self.edit_root_changing)
|
|
135
|
-
self.ui.edit_root.editingFinished.connect(self.edit_root_finished)
|
|
136
|
-
self.ui.edit_root.returnPressed.connect(\
|
|
137
|
-
self.addParWrapper(self.edit_root_callback,'Pattern of image filenames'))
|
|
138
|
-
self.ui.button_import.clicked.connect(\
|
|
139
|
-
self.addParWrapper(self.button_import_callback,'Pattern of image filenames'))
|
|
140
|
-
self.ui.edit_root.FunSetCompleterList=self.setRootCompleter
|
|
141
|
-
|
|
142
|
-
self.setSpinCallbacks(['range_from','range_to'],['Number of the first image','Number of pairs'])
|
|
143
|
-
self.ui.spin_range_from.valueChanged.connect(self.spin_range_from_callback)
|
|
144
|
-
self.ui.spin_range_to.valueChanged.connect(self.spin_range_to_callback)
|
|
145
|
-
fSpinSCallback=self.addParWrapper(self.spin_selected_callback,'Selection of pair')
|
|
146
|
-
self.ui.spin_selected.valueChanged.connect(fSpinSCallback)
|
|
147
|
-
fListSCallback=self.addParWrapper(self.list_images_callback,'Selection of pair')
|
|
148
|
-
self.ui.list_images.currentRowChanged.connect(fListSCallback)
|
|
149
|
-
|
|
150
|
-
self.ui.check_TR_sequence.stateChanged.connect(self.addParWrapper(self.check_TR_callback,'Time-resolved series'))
|
|
151
|
-
self.ui.check_subtract.stateChanged.connect(self.addParWrapper(self.check_subtract_callback,'Subtract minimum'))
|
|
152
|
-
|
|
153
|
-
self.setSpinxywhCallbacks()
|
|
154
|
-
|
|
155
|
-
#*************************************************** From Parameters to UI
|
|
156
|
-
def setINPpar(self):
|
|
157
|
-
self.FlagSettingPar=True
|
|
158
|
-
#pri.Time.blue(1,'INPpar: beginning')
|
|
159
|
-
self.ChangeText_path(self.INPpar.path)
|
|
160
|
-
self.setPathLabel()
|
|
161
|
-
self.setPathCompleter()
|
|
162
|
-
self.ChangeText_root(self.INPpar.root)
|
|
163
|
-
self.setRootCompleter()
|
|
164
|
-
self.setRootLabel()
|
|
165
|
-
if self.INPpar.FlagValidRoot in (0,-10):
|
|
166
|
-
self.Disable_ImgObjects()
|
|
167
|
-
else:
|
|
168
|
-
self.Enable_ImgObjects()
|
|
169
|
-
#pri.Time.blue(0,'INPpar: path-root')
|
|
170
|
-
|
|
171
|
-
fields=['range_from','range_to','pinfo','FlagList']
|
|
172
|
-
#if self.INPpar.isDifferentFrom(self.INPpar_old,[],fields):
|
|
173
|
-
self.setListImages()
|
|
174
|
-
#pri.Time.blue(0,'INPpar: list')
|
|
175
|
-
self.ui.check_TR_sequence.setChecked(self.INPpar.flag_TR)
|
|
176
|
-
self.ui.check_subtract.setChecked(self.INPpar.flag_min)
|
|
177
|
-
self.setMinMaxSpin()
|
|
178
|
-
if self.INPpar.isDifferentFrom(self.INPpar_old,self.INPpar.unchecked_fields,['pinfo']):
|
|
179
|
-
self.INPpar.selected=imin_im_pair
|
|
180
|
-
self.setValueSpin()
|
|
181
|
-
self.FlagSettingPar=False
|
|
182
|
-
#pri.Time.blue(0,'INPpar: end')
|
|
183
|
-
|
|
184
|
-
def ChangeText_path(self,text):
|
|
185
|
-
text=myStandardPath(text)
|
|
186
|
-
self.ui.edit_path.setText(text)
|
|
187
|
-
|
|
188
|
-
def setPathLabel(self):
|
|
189
|
-
if self.INPpar.FlagValidPath==1:
|
|
190
|
-
self.ui.label_check_path.setPixmap(self.mapv)
|
|
191
|
-
self.ui.label_check_path.setToolTip("This path exists! 😃")
|
|
192
|
-
elif self.INPpar.FlagValidPath==0:
|
|
193
|
-
self.ui.label_check_path.setPixmap(self.mapx)
|
|
194
|
-
self.ui.label_check_path.setToolTip("This path does not exist! 😞")
|
|
195
|
-
elif self.INPpar.FlagValidPath==-10:
|
|
196
|
-
self.ui.label_check_path.setPixmap(self.mapw)
|
|
197
|
-
self.ui.label_check_path.setToolTip("This path is currently under inspection! ⌛")
|
|
198
|
-
#if self.INPpar.FlagValidPath in (0,-10):
|
|
199
|
-
#self.ui.w_edit_root.setEnabled(False)
|
|
200
|
-
#self.ui.button_import.setEnabled(False)
|
|
201
|
-
#else:
|
|
202
|
-
#self.ui.edit_root.setEnabled(True)
|
|
203
|
-
#self.ui.button_import.setEnabled(True)
|
|
204
|
-
self.edit_path_label=self.ui.label_check_path.pixmap()
|
|
205
|
-
|
|
206
|
-
def setPathCompleter(self):
|
|
207
|
-
self.edit_path_completer=QCompleter(self.INPpar.pathCompleter)
|
|
208
|
-
self.edit_path_completer.setCompletionMode(QCompleter.CompletionMode(1))
|
|
209
|
-
self.edit_path_completer.setModelSorting(QCompleter.ModelSorting(2))
|
|
210
|
-
self.edit_path_completer.setWidget(self.ui.edit_path)
|
|
211
|
-
if self.INPpar.path in self.INPpar.pathCompleter:
|
|
212
|
-
k=self.INPpar.pathCompleter.index(self.INPpar.path)
|
|
213
|
-
self.edit_path_completer.setCurrentRow(k)
|
|
214
|
-
self.ui.edit_path.setCompleter(self.edit_path_completer)
|
|
215
|
-
self.ui.edit_path.FlagCompleter=True
|
|
216
|
-
|
|
217
|
-
def ChangeText_root(self,text,*args):
|
|
218
|
-
text=myStandardRoot(text)
|
|
219
|
-
text=text.replace(';',' ; ')
|
|
220
|
-
self.ui.edit_root.setText(text)
|
|
221
|
-
|
|
222
|
-
def setFlagValidRoot(self,*args):
|
|
223
|
-
if len(args): INPpar_prev=args[0]
|
|
224
|
-
else: INPpar_prev=self.INPpar
|
|
225
|
-
if INPpar_prev.FlagValidPath in (0,-10):
|
|
226
|
-
INPpar_prev.FlagValidRoot=-10
|
|
227
|
-
else:
|
|
228
|
-
if not len(INPpar_prev.list_eim):
|
|
229
|
-
INPpar_prev.FlagValidRoot=0
|
|
230
|
-
else:
|
|
231
|
-
FlagExistAll=all(INPpar_prev.list_eim[INPpar_prev.list_ind_items[0]:INPpar_prev.list_ind_items[1]])
|
|
232
|
-
if FlagExistAll:
|
|
233
|
-
INPpar_prev.FlagValidRoot=1
|
|
234
|
-
else:
|
|
235
|
-
INPpar_prev.FlagValidRoot=-1
|
|
236
|
-
|
|
237
|
-
def setRootLabel(self):
|
|
238
|
-
if self.INPpar.FlagValidRoot==1:
|
|
239
|
-
self.ui.label_check_root.setPixmap(self.mapv)
|
|
240
|
-
self.ui.label_check_root.setToolTip("Files correctly identified! 😃")
|
|
241
|
-
elif self.INPpar.FlagValidRoot==0 or self.INPpar.FlagValidPath==0:
|
|
242
|
-
self.ui.label_check_root.setPixmap(self.mapx)
|
|
243
|
-
self.ui.label_check_root.setToolTip("There are no files with this filename root in the selected path! 😞")
|
|
244
|
-
elif self.INPpar.FlagValidRoot==-1:
|
|
245
|
-
self.ui.label_check_root.setPixmap(self.Lab_warning)
|
|
246
|
-
self.ui.label_check_root.setToolTip("Some files seem missing: please, check! 🧐")
|
|
247
|
-
elif self.INPpar.FlagValidRoot==-10:
|
|
248
|
-
self.ui.label_check_root.setPixmap(self.mapw)
|
|
249
|
-
self.ui.label_check_root.setToolTip("This pattern is currently under inspection! ⌛")
|
|
250
|
-
#if self.INPpar.FlagValidRoot in (0,-10):
|
|
251
|
-
#self.ui.edit_root.setEnabled(False)
|
|
252
|
-
#self.ui.button_import.setEnabled(False)
|
|
253
|
-
#else:
|
|
254
|
-
self.ui.w_edit_root.setEnabled(True)
|
|
255
|
-
#self.ui.button_import.setEnabled(True)
|
|
256
|
-
self.edit_root_label=self.ui.label_check_root.pixmap()
|
|
257
|
-
|
|
258
|
-
def setRootCompleter(self):
|
|
259
|
-
roots=[r for k,r in enumerate(self.INPpar.Pinfo.root) if self.INPpar.Pinfo.nimg_tot[k]]
|
|
260
|
-
self.edit_root_completer=QCompleter(roots)
|
|
261
|
-
self.edit_root_completer.setCompletionMode(QCompleter.CompletionMode(1))
|
|
262
|
-
self.edit_root_completer.setModelSorting(QCompleter.ModelSorting(2))
|
|
263
|
-
self.edit_root_completer.setWidget(self.ui.edit_root)
|
|
264
|
-
if len(roots):
|
|
265
|
-
if self.INPpar.root in roots:
|
|
266
|
-
k=roots.index(self.INPpar.root)
|
|
267
|
-
self.edit_root_completer.setCurrentRow(k)
|
|
268
|
-
self.ui.edit_root.setCompleter(self.edit_root_completer)
|
|
269
|
-
self.ui.edit_root.FlagCompleter=True
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
def setMinMaxSpin(self):
|
|
273
|
-
value_range_from=self.INPpar.range_from
|
|
274
|
-
value_range_to=self.INPpar.range_to
|
|
275
|
-
value_selected=self.INPpar.selected
|
|
276
|
-
self.ui.spin_range_from.setMinimum(self.INPpar.pinfo.ind_in)
|
|
277
|
-
self.ui.spin_range_from.setMaximum(self.INPpar.pinfo.ind_fin-(self.INPpar.pinfo.nfra==1)*1)
|
|
278
|
-
self.newTip('spin_range_from')
|
|
279
|
-
self.ui.spin_range_to.setMinimum(1)
|
|
280
|
-
self.ui.spin_range_to.setMaximum(self.INPpar.npairs)
|
|
281
|
-
self.newTip('spin_range_to')
|
|
282
|
-
self.ui.spin_selected.setMinimum(imin_im_pair-1)
|
|
283
|
-
self.ui.spin_selected.setMaximum(self.INPpar.npairs-1+imin_im_pair)
|
|
284
|
-
self.setMinMaxSpinxywh()
|
|
285
|
-
self.INPpar.range_from=value_range_from
|
|
286
|
-
self.INPpar.range_to=value_range_to
|
|
287
|
-
self.INPpar.selected=value_selected
|
|
288
|
-
|
|
289
|
-
def setValueSpin(self):
|
|
290
|
-
self.ui.spin_range_from.setValue(self.INPpar.range_from)
|
|
291
|
-
self.ui.spin_range_to.setValue(self.INPpar.range_to)
|
|
292
|
-
self.ui.spin_selected.setValue(self.INPpar.selected)
|
|
293
|
-
self.selectListItem()
|
|
294
|
-
self.setValueSpinxywh()
|
|
295
|
-
|
|
296
|
-
def Disable_ImgObjects(self):
|
|
297
|
-
self.setMinMaxSpin()
|
|
298
|
-
for nobj in range(len(self.spin_fields)):
|
|
299
|
-
obj=getattr(self.ui,self.list_Spins[nobj])
|
|
300
|
-
obj.setEnabled(False)
|
|
301
|
-
field_value=getattr(self.INPpar_base,self.spin_fields[nobj])
|
|
302
|
-
obj.setValue(field_value)
|
|
303
|
-
self.ui.list_images.clear()
|
|
304
|
-
self.ui.list_images.setEnabled(False)
|
|
305
|
-
for nobj in range(len(self.TR_min_fields)):
|
|
306
|
-
obj=getattr(self.ui,self.list_Image_Opt[nobj])
|
|
307
|
-
obj.setEnabled(False)
|
|
308
|
-
|
|
309
|
-
def Enable_ImgObjects(self):
|
|
310
|
-
for nobj in range(len(self.list_Spins)):
|
|
311
|
-
obj=getattr(self.ui,self.list_Spins[nobj])
|
|
312
|
-
obj.setEnabled(True)
|
|
313
|
-
self.ui.list_images.setEnabled(True)
|
|
314
|
-
for nobj in range(len(self.list_Image_Opt)):
|
|
315
|
-
obj=getattr(self.ui,self.list_Image_Opt[nobj])
|
|
316
|
-
obj.setEnabled(True)
|
|
317
|
-
|
|
318
|
-
#*************************************************** Path and Images utilities
|
|
319
|
-
def getPinfoFromPath(self,INPpar_prev,currpath_target):
|
|
320
|
-
INPpar_prev: INPpar
|
|
321
|
-
#INPpar_prev=self.INPpar_prev[ind_prev]
|
|
322
|
-
INPpar_prev.path=currpath_target[0]
|
|
323
|
-
target=currpath_target[1]
|
|
324
|
-
|
|
325
|
-
if os.path.exists(INPpar_prev.path):
|
|
326
|
-
INPpar_prev.FlagValidPath=-10
|
|
327
|
-
Pinfo=analysePath(INPpar_prev.path)
|
|
328
|
-
INPpar_prev.FlagValidPath=1
|
|
329
|
-
self.selectRootInPath(INPpar_prev,[Pinfo,target])
|
|
330
|
-
else:
|
|
331
|
-
INPpar_prev.FlagValidPath=INPpar_prev.FlagValidRoot=0
|
|
332
|
-
INPpar_prev.Pinfo=patternInfoList()
|
|
333
|
-
INPpar_prev.pinfo=patternInfoVar()
|
|
334
|
-
INPpar_prev.root=''
|
|
335
|
-
self.setInfoImages(INPpar_prev,[True,[]])
|
|
336
|
-
return INPpar_prev
|
|
337
|
-
|
|
338
|
-
@Slot(int,list)
|
|
339
|
-
def selectRootInPath(self,INPpar_prev,Pinfo_target):
|
|
340
|
-
INPpar_prev: INPpar
|
|
341
|
-
Pinfo: patternInfoList
|
|
342
|
-
#INPpar_prev=self.INPpar_prev[ind_prev]
|
|
343
|
-
Pinfo=Pinfo_target[0]
|
|
344
|
-
target=Pinfo_target[1]
|
|
345
|
-
if Pinfo.pattern!=None:
|
|
346
|
-
INPpar_prev.Pinfo=Pinfo.duplicate()
|
|
347
|
-
if len(INPpar_prev.Pinfo.pattern):
|
|
348
|
-
if target:
|
|
349
|
-
vk=[]
|
|
350
|
-
vnimg=[]
|
|
351
|
-
for k in range(len(INPpar_prev.Pinfo.pa)):
|
|
352
|
-
if INPpar_prev.Pinfo.pa[k].match(target):
|
|
353
|
-
vk.append(k)
|
|
354
|
-
vnimg.append(INPpar_prev.Pinfo.nimg_tot[k])
|
|
355
|
-
k=vk[np.argmax(np.asarray(vnimg))]
|
|
356
|
-
else:
|
|
357
|
-
k=np.argmax(np.asarray(Pinfo.nimg_tot))
|
|
358
|
-
INPpar_prev.pinfo=INPpar_prev.Pinfo.extractPinfo(k)
|
|
359
|
-
INPpar_prev.root=INPpar_prev.pinfo.root
|
|
360
|
-
INPpar_prev.FlagValidRoot=-10
|
|
361
|
-
self.setRoot(INPpar_prev,True)
|
|
362
|
-
else:
|
|
363
|
-
INPpar_prev.pinfo=patternInfoVar()
|
|
364
|
-
INPpar_prev.root=''
|
|
365
|
-
INPpar_prev.FlagValidRoot=0
|
|
366
|
-
self.setInfoImages(INPpar_prev,[True,[]])
|
|
367
|
-
return INPpar_prev
|
|
368
|
-
|
|
369
|
-
def setRoot(self,INPpar_prev,flagDefault):
|
|
370
|
-
INPpar_prev: INPpar
|
|
371
|
-
#INPpar_prev=self.INPpar_prev[ind_prev]
|
|
372
|
-
|
|
373
|
-
infoImages=createListImages(INPpar_prev.path,INPpar_prev.pinfo,INPpar_prev.flag_TR)
|
|
374
|
-
self.setInfoImages(INPpar_prev,[flagDefault,infoImages])
|
|
375
|
-
return INPpar_prev
|
|
376
|
-
|
|
377
|
-
@Slot(int,list)
|
|
378
|
-
def setInfoImages(self,INPpar_prev:INPpar,flagDefault_infoImages):
|
|
379
|
-
INPpar_prev: INPpar
|
|
380
|
-
#INPpar_prev=self.INPpar_prev[ind_prev]
|
|
381
|
-
flagDefault=flagDefault_infoImages[0]
|
|
382
|
-
infoImages=flagDefault_infoImages[1]
|
|
383
|
-
|
|
384
|
-
if not len(infoImages):
|
|
385
|
-
INPpar_prev.FlagValidRoot=0
|
|
386
|
-
infoImages=[[],[],[],[],0,INPpar().W,INPpar().H,False]
|
|
387
|
-
if flagDefault:
|
|
388
|
-
INPpar_prev.FlagValidRoot=1
|
|
389
|
-
flagTR=bool(infoImages[7])
|
|
390
|
-
INPpar_prev.npairs=infoImages[4]
|
|
391
|
-
INPpar_prev.nspa_eff=INPpar_prev.pinfo.nfra*(1+1*(bool(INPpar_prev.flag_TR)))
|
|
392
|
-
INPpar_prev.nimg_eff=INPpar_prev.pinfo.nimg*INPpar_prev.nspa_eff-1*flagTR
|
|
393
|
-
INPpar_prev.range_from=INPpar_prev.pinfo.ind_in
|
|
394
|
-
INPpar_prev.range_to=INPpar_prev.npairs
|
|
395
|
-
|
|
396
|
-
INPpar_prev.x=INPpar_prev.y=0
|
|
397
|
-
INPpar_prev.w=INPpar_prev.W=infoImages[5]
|
|
398
|
-
INPpar_prev.h=INPpar_prev.H=infoImages[6]
|
|
399
|
-
|
|
400
|
-
INPpar_prev.list_Image_Files=infoImages[0]
|
|
401
|
-
INPpar_prev.list_eim=infoImages[1]
|
|
402
|
-
INPpar_prev.list_Image_numbers=infoImages[2]
|
|
403
|
-
INPpar_prev.list_items=infoImages[3]
|
|
404
|
-
ind_in=(INPpar_prev.range_from-INPpar_prev.pinfo.ind_in)*INPpar_prev.nspa_eff
|
|
405
|
-
ind_fin=ind_in+INPpar_prev.range_to*2
|
|
406
|
-
INPpar_prev.list_ind_items=[ind_in, ind_fin]
|
|
407
|
-
self.setFlagValidRoot(INPpar_prev)
|
|
408
|
-
return INPpar_prev
|
|
409
|
-
|
|
410
|
-
def setListImages(self):
|
|
411
|
-
FlagSettingPar=self.FlagSettingPar
|
|
412
|
-
self.FlagSettingPar=True
|
|
413
|
-
self.ui.list_images.clear()
|
|
414
|
-
if not len(self.INPpar.list_Image_Files): return
|
|
415
|
-
ind_in=(self.INPpar.range_from-self.INPpar.pinfo.ind_in)*self.INPpar.nspa_eff
|
|
416
|
-
ind_fin=ind_in+self.INPpar.range_to*2
|
|
417
|
-
self.INPpar.list_ind_items=self.INPpar.list_ind_items=[ind_in,ind_fin]
|
|
418
|
-
|
|
419
|
-
listImage=[str(num+imin_im_pair)+": "+im1+' - '+im2 for num,im1,im2 in\
|
|
420
|
-
zip(range(self.INPpar.range_to),self.INPpar.list_items[ind_in:ind_fin:2],self.INPpar.list_items[ind_in+1:ind_fin:2])]
|
|
421
|
-
#listImage=[num+im for num,im in zip(self.list_Image_numbers[:nimg],self.list_Image_items[ind_in:ind_fin])]
|
|
422
|
-
self.ui.list_images.addItems(listImage)
|
|
423
|
-
self.FlagSettingPar=FlagSettingPar
|
|
424
|
-
|
|
425
|
-
def getpinfofromRoot(self,INPpar_prev,path_pattern):
|
|
426
|
-
INPpar_prev: INPpar
|
|
427
|
-
#INPpar_prev=self.INPpar_prev[ind_prev]
|
|
428
|
-
path=path_pattern[0]
|
|
429
|
-
pattern=path_pattern[1]
|
|
430
|
-
|
|
431
|
-
if INPpar_prev.root=='':
|
|
432
|
-
INPpar_prev.pinfo=patternInfoVar()
|
|
433
|
-
INPpar_prev.FlagValidRoot=0
|
|
434
|
-
else:
|
|
435
|
-
if pattern in INPpar_prev.Pinfo.root:
|
|
436
|
-
k=INPpar_prev.Pinfo.root.index(pattern)
|
|
437
|
-
pinfo=INPpar_prev.Pinfo.extractPinfo(k)
|
|
438
|
-
INPpar_prev.FlagValidRoot=1
|
|
439
|
-
else:
|
|
440
|
-
INPpar_prev.FlagValidRoot=-10
|
|
441
|
-
pinfo=analyseRoot(path,pattern)
|
|
442
|
-
self.setNewpinfo(INPpar_prev,[pinfo])
|
|
443
|
-
return INPpar_prev
|
|
444
|
-
|
|
445
|
-
@Slot(int,list)
|
|
446
|
-
def setNewpinfo(self,INPpar_prev,pinfo_):
|
|
447
|
-
INPpar_prev: INPpar
|
|
448
|
-
#INPpar_prev=self.INPpar_prev[ind_prev]
|
|
449
|
-
|
|
450
|
-
pinfo=pinfo_[0] #if pinfo_[0].nimg_tot else INPpar_prev.pinfo
|
|
451
|
-
if pinfo.root in INPpar_prev.Pinfo.root:
|
|
452
|
-
k=INPpar_prev.Pinfo.root.index(pinfo.root)
|
|
453
|
-
else:
|
|
454
|
-
INPpar_prev.Pinfo=pinfo.addto(INPpar_prev.Pinfo)
|
|
455
|
-
k=len(INPpar_prev.Pinfo.pattern)-1
|
|
456
|
-
INPpar_prev.pinfo=INPpar_prev.Pinfo.extractPinfo(k)
|
|
457
|
-
INPpar_prev.root=INPpar_prev.pinfo.root
|
|
458
|
-
infoImages=createListImages(INPpar_prev.path,pinfo,INPpar_prev.flag_TR)
|
|
459
|
-
flagDefault=True
|
|
460
|
-
self.setInfoImages(INPpar_prev,[flagDefault,infoImages])
|
|
461
|
-
return INPpar_prev
|
|
462
|
-
|
|
463
|
-
#*************************************************** Edit path and root
|
|
464
|
-
def edit_path_changing(self):
|
|
465
|
-
self.ui.label_check_path.setPixmap(QPixmap())
|
|
466
|
-
|
|
467
|
-
def edit_path_finished(self):
|
|
468
|
-
self.ui.edit_path.setText(self.INPpar.path)
|
|
469
|
-
self.setPathLabel()
|
|
470
|
-
|
|
471
|
-
def edit_path_action(self,*args):
|
|
472
|
-
if len(args): target=args[0]
|
|
473
|
-
else: target=''
|
|
474
|
-
currpath=myStandardPath(self.ui.edit_path.text())
|
|
475
|
-
directory_path = myStandardPath(os.getcwd())
|
|
476
|
-
if directory_path in currpath:
|
|
477
|
-
currpath=currpath.replace(directory_path,'./')
|
|
478
|
-
self.ui.edit_path.setText(currpath)
|
|
479
|
-
flagNewPath=self.INPpar.path!=currpath
|
|
480
|
-
self.INPpar.path=currpath
|
|
481
|
-
self.INPpar.FlagValidPath=self.INPpar.FlagValidRoot=-10
|
|
482
|
-
|
|
483
|
-
if not flagNewPath:
|
|
484
|
-
if len(self.INPpar.list_Image_Files): target=self.INPpar.list_Image_Files[0]
|
|
485
|
-
#FlagAddPar=-1
|
|
486
|
-
FlagAddPar=+1
|
|
487
|
-
else:
|
|
488
|
-
if os.path.exists(self.INPpar.path):
|
|
489
|
-
if self.INPpar.path in self.INPpar.pathCompleter:
|
|
490
|
-
self.INPpar.pathCompleter.pop(self.INPpar.pathCompleter.index(self.INPpar.path))
|
|
491
|
-
self.INPpar.pathCompleter.insert(0,self.INPpar.path)
|
|
492
|
-
if len(self.INPpar.pathCompleter)>10: self.INPpar.pathCompleter=self.INPpar.pathCompleter[:10]
|
|
493
|
-
FlagAddPar=1
|
|
494
|
-
fcallback_done=lambda i: self.getPinfoFromPath(i,[currpath,target])
|
|
495
|
-
return [FlagAddPar,fcallback_done]
|
|
496
|
-
|
|
497
|
-
def button_path_callback(self):
|
|
498
|
-
directory = str(QFileDialog.getExistingDirectory(self,\
|
|
499
|
-
"Choose a folder", dir=self.INPpar.path,options=optionNativeDialog))
|
|
500
|
-
currpath='{}'.format(directory)
|
|
501
|
-
if not currpath=='':
|
|
502
|
-
self.ui.edit_path.setText(currpath)
|
|
503
|
-
out_edit_path=self.edit_path_action()
|
|
504
|
-
return out_edit_path
|
|
505
|
-
else:
|
|
506
|
-
return [-1,None]
|
|
507
|
-
|
|
508
|
-
def edit_root_changing(self):
|
|
509
|
-
self.ui.label_check_root.setPixmap(QPixmap())
|
|
510
|
-
|
|
511
|
-
def edit_root_finished(self):
|
|
512
|
-
self.ui.edit_root.setText(self.INPpar.root)
|
|
513
|
-
self.setRootLabel()
|
|
514
|
-
|
|
515
|
-
def edit_root_callback(self):
|
|
516
|
-
currpatt=self.ui.edit_root.text()
|
|
517
|
-
flagNewRoot=currpatt.replace(" ","")!=self.INPpar.root.replace(" ","")
|
|
518
|
-
self.ui.edit_root.setText(currpatt)
|
|
519
|
-
self.ui.edit_root.repaint()
|
|
520
|
-
self.INPpar.root=currpatt
|
|
521
|
-
self.INPpar.FlagValidRoot=-10
|
|
522
|
-
if not flagNewRoot:
|
|
523
|
-
#FlagAddPar=-1
|
|
524
|
-
FlagAddPar=+1
|
|
525
|
-
else:
|
|
526
|
-
FlagAddPar=1
|
|
527
|
-
fcallback_done=lambda i: self.getpinfofromRoot(i,[self.INPpar.path,currpatt])
|
|
528
|
-
return [FlagAddPar,fcallback_done]
|
|
529
|
-
|
|
530
|
-
def button_import_callback(self):
|
|
531
|
-
self.ui.label_check_root.setPixmap(self.mapw)
|
|
532
|
-
filename, _ = QFileDialog.getOpenFileName(self,\
|
|
533
|
-
"Select an image file of the sequence", filter=text_filter, dir=self.INPpar.path,\
|
|
534
|
-
options=optionNativeDialog)
|
|
535
|
-
filename=myStandardRoot('{}'.format(str(filename)))
|
|
536
|
-
if not filename=='':
|
|
537
|
-
directory_path = myStandardPath(os.getcwd())
|
|
538
|
-
currpath, target = os.path.split(filename)
|
|
539
|
-
currpath=myStandardPath(currpath)
|
|
540
|
-
if directory_path in currpath:
|
|
541
|
-
currpath=currpath.replace(directory_path,'./')
|
|
542
|
-
if currpath==myStandardPath(self.ui.edit_path.text()):
|
|
543
|
-
vk=[]
|
|
544
|
-
vnimg=[]
|
|
545
|
-
for k in range(len(self.INPpar.Pinfo.pa)):
|
|
546
|
-
if self.INPpar.Pinfo.pa[k].match(target):
|
|
547
|
-
vk.append(k)
|
|
548
|
-
vnimg.append(self.INPpar.Pinfo.nimg_tot[k])
|
|
549
|
-
k=vk[np.argmax(np.asarray(vnimg))]
|
|
550
|
-
self.ui.edit_root.setText(self.INPpar.Pinfo.root[k])
|
|
551
|
-
out_edit_root=self.edit_root_callback()
|
|
552
|
-
return out_edit_root
|
|
553
|
-
else:
|
|
554
|
-
self.ui.edit_path.setText(currpath)
|
|
555
|
-
out_edit_path=self.edit_path_action(target)
|
|
556
|
-
return out_edit_path
|
|
557
|
-
else:
|
|
558
|
-
return [-1,None]
|
|
559
|
-
|
|
560
|
-
#*************************************************** Image set controls
|
|
561
|
-
def spin_range_from_callback(self):
|
|
562
|
-
if not self.FlagSettingPar:
|
|
563
|
-
flag=self.ui.spin_range_from.value()!=self.INPpar.range_from
|
|
564
|
-
if flag:
|
|
565
|
-
self.INPpar.range_from=self.ui.spin_range_from.value()
|
|
566
|
-
if self.ui.spin_range_from.hasFocus():
|
|
567
|
-
self.spin_range_from_action()
|
|
568
|
-
self.setListImages()
|
|
569
|
-
self.ui.spin_range_from.setFocus()
|
|
570
|
-
return [1,None]
|
|
571
|
-
else:
|
|
572
|
-
return [-1,None]
|
|
573
|
-
|
|
574
|
-
def spin_range_from_action(self):
|
|
575
|
-
value=self.ui.spin_range_from.value()
|
|
576
|
-
ind_in=(value-self.INPpar.pinfo.ind_in)*self.INPpar.nspa_eff
|
|
577
|
-
d=int((self.INPpar.nimg_eff-ind_in)/2)
|
|
578
|
-
self.INPpar.list_ind_items[0]=ind_in
|
|
579
|
-
self.ui.spin_range_to.setMaximum(d)
|
|
580
|
-
self.newTip('spin_range_to')
|
|
581
|
-
self.ui.spin_range_to.setValue(d)
|
|
582
|
-
self.ui.spin_selected.setMaximum(d-1+imin_im_pair)
|
|
583
|
-
|
|
584
|
-
def spin_range_to_callback(self):
|
|
585
|
-
if not self.FlagSettingPar:
|
|
586
|
-
flag=self.ui.spin_range_to.value()!=self.INPpar.range_to
|
|
587
|
-
if flag:
|
|
588
|
-
self.INPpar.range_to=self.ui.spin_range_to.value()
|
|
589
|
-
if self.ui.spin_range_to.hasFocus():
|
|
590
|
-
self.spin_range_to_action()
|
|
591
|
-
self.setListImages()
|
|
592
|
-
self.ui.spin_range_to.setFocus()
|
|
593
|
-
return [1,None]
|
|
594
|
-
else:
|
|
595
|
-
return [-1,None]
|
|
596
|
-
|
|
597
|
-
def spin_range_to_action(self):
|
|
598
|
-
value=self.ui.spin_range_to.value()
|
|
599
|
-
value_selected=value-1+imin_im_pair
|
|
600
|
-
if self.INPpar.selected>value_selected:
|
|
601
|
-
self.INPpar.selected=value_selected
|
|
602
|
-
self.ui.spin_selected.setValue(value_selected)
|
|
603
|
-
self.ui.spin_selected.setMaximum(value_selected)
|
|
604
|
-
|
|
605
|
-
def spin_selected_callback(self):
|
|
606
|
-
if not self.FlagSettingPar:
|
|
607
|
-
self.INPpar.selected=self.ui.spin_selected.value()
|
|
608
|
-
if self.ui.spin_selected.hasFocus():
|
|
609
|
-
self.spin_selected_action()
|
|
610
|
-
self.ui.spin_selected.setFocus()
|
|
611
|
-
return [0,None]
|
|
612
|
-
else:
|
|
613
|
-
return [-1,None]
|
|
614
|
-
|
|
615
|
-
def spin_selected_action(self):
|
|
616
|
-
self.INPpar.selected=self.ui.spin_selected.value()
|
|
617
|
-
self.selectListItem()
|
|
618
|
-
|
|
619
|
-
def selectListItem(self):
|
|
620
|
-
ind=self.INPpar.selected-imin_im_pair
|
|
621
|
-
self.ui.list_images.setCurrentRow(ind)
|
|
622
|
-
|
|
623
|
-
def list_images_callback(self):
|
|
624
|
-
if not self.FlagSettingPar:
|
|
625
|
-
ind=self.ui.list_images.currentRow()
|
|
626
|
-
self.ui.spin_selected.setValue(ind+imin_im_pair)
|
|
627
|
-
self.INPpar.selected=self.ui.spin_selected.value()
|
|
628
|
-
return [0,None]
|
|
629
|
-
else:
|
|
630
|
-
return [-1,None]
|
|
631
|
-
|
|
632
|
-
#*************************************************** Sequence type and pre-proc
|
|
633
|
-
def check_TR_callback(self):
|
|
634
|
-
if self.ui.check_TR_sequence.hasFocus():
|
|
635
|
-
self.INPpar.flag_TR=self.ui.check_TR_sequence.isChecked()
|
|
636
|
-
fcallback_done=lambda i: self.setRoot(i,True)
|
|
637
|
-
return [1,fcallback_done]
|
|
638
|
-
else:
|
|
639
|
-
return [-1,None]
|
|
640
|
-
|
|
641
|
-
def check_subtract_callback(self):
|
|
642
|
-
if self.ui.check_subtract.hasFocus():
|
|
643
|
-
self.INPpar.flag_min=self.ui.check_subtract.isChecked()
|
|
644
|
-
return [1,None]
|
|
645
|
-
else:
|
|
646
|
-
return [-1,None]
|
|
647
|
-
|
|
648
|
-
if __name__ == "__main__":
|
|
649
|
-
import sys
|
|
650
|
-
app=QApplication.instance()
|
|
651
|
-
if not app:app = QApplication(sys.argv)
|
|
652
|
-
app.setStyle('Fusion')
|
|
653
|
-
object = Import_Tab(None)
|
|
654
|
-
object.show()
|
|
655
|
-
app.exec()
|
|
656
|
-
app.quit()
|
|
657
|
-
app=None
|