PaIRS-UniNa 0.2.10__cp313-cp313-macosx_11_0_universal2.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 +347 -0
- PaIRS_UniNa/Changes.txt +174 -0
- PaIRS_UniNa/Custom_Top.py +303 -0
- PaIRS_UniNa/Explorer.py +3322 -0
- PaIRS_UniNa/FolderLoop.py +562 -0
- PaIRS_UniNa/Input_Tab.py +829 -0
- PaIRS_UniNa/Input_Tab_CalVi.py +787 -0
- PaIRS_UniNa/Input_Tab_tools.py +3026 -0
- PaIRS_UniNa/Log_Tab.py +110 -0
- PaIRS_UniNa/Output_Tab.py +922 -0
- PaIRS_UniNa/PaIRS.py +18 -0
- PaIRS_UniNa/PaIRS_PIV.py +873 -0
- PaIRS_UniNa/PaIRS_pypacks.py +1374 -0
- PaIRS_UniNa/Process_Tab.py +1761 -0
- PaIRS_UniNa/Process_Tab_CalVi.py +313 -0
- PaIRS_UniNa/Process_Tab_Disp.py +170 -0
- PaIRS_UniNa/Process_Tab_Min.py +120 -0
- PaIRS_UniNa/ResizePopup.py +55 -0
- PaIRS_UniNa/SPIVCalHelp.py +155 -0
- PaIRS_UniNa/Saving_tools.py +298 -0
- PaIRS_UniNa/TabTools.py +1413 -0
- PaIRS_UniNa/Vis_Tab.py +2176 -0
- PaIRS_UniNa/Vis_Tab_CalVi.py +982 -0
- PaIRS_UniNa/Whatsnew.py +130 -0
- PaIRS_UniNa/_PaIRS_PIV.so +0 -0
- PaIRS_UniNa/__init__.py +6 -0
- PaIRS_UniNa/__main__.py +45 -0
- PaIRS_UniNa/addwidgets_ps.py +1633 -0
- PaIRS_UniNa/calib.py +1488 -0
- PaIRS_UniNa/calibView.py +833 -0
- PaIRS_UniNa/gPaIRS.py +3957 -0
- PaIRS_UniNa/gPalette.py +189 -0
- PaIRS_UniNa/icons/abort.png +0 -0
- PaIRS_UniNa/icons/about.png +0 -0
- 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/axes.png +0 -0
- PaIRS_UniNa/icons/background.png +0 -0
- PaIRS_UniNa/icons/background_vectors.png +0 -0
- PaIRS_UniNa/icons/bin_off.png +0 -0
- PaIRS_UniNa/icons/bin_on.png +0 -0
- PaIRS_UniNa/icons/browse_file_c.png +0 -0
- PaIRS_UniNa/icons/browse_folder_c.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/calibrate.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/checklist.png +0 -0
- PaIRS_UniNa/icons/clean.png +0 -0
- PaIRS_UniNa/icons/clean_run.png +0 -0
- PaIRS_UniNa/icons/close.png +0 -0
- PaIRS_UniNa/icons/close_all.png +0 -0
- PaIRS_UniNa/icons/close_project.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/copygrid.png +0 -0
- PaIRS_UniNa/icons/cursor_lamp.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/debug_run.png +0 -0
- PaIRS_UniNa/icons/delete.png +0 -0
- PaIRS_UniNa/icons/deleteErr.png +0 -0
- PaIRS_UniNa/icons/disp_step.png +0 -0
- PaIRS_UniNa/icons/disp_step_off.png +0 -0
- PaIRS_UniNa/icons/down.png +0 -0
- PaIRS_UniNa/icons/edit_list.png +0 -0
- PaIRS_UniNa/icons/editing.png +0 -0
- PaIRS_UniNa/icons/example_list.png +0 -0
- PaIRS_UniNa/icons/find_all_planes.png +0 -0
- PaIRS_UniNa/icons/find_plane.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS_beta.png +0 -0
- PaIRS_UniNa/icons/flaticon_PaIRS_download.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/focusErrr.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/ger.png +0 -0
- PaIRS_UniNa/icons/greenv.png +0 -0
- PaIRS_UniNa/icons/guide.png +0 -0
- PaIRS_UniNa/icons/icon_CalVi.png +0 -0
- PaIRS_UniNa/icons/icon_PaIRS.png +0 -0
- PaIRS_UniNa/icons/import.png +0 -0
- PaIRS_UniNa/icons/import_set.png +0 -0
- PaIRS_UniNa/icons/information.png +0 -0
- PaIRS_UniNa/icons/information2.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/loaded.png +0 -0
- PaIRS_UniNa/icons/loading_2.gif +0 -0
- PaIRS_UniNa/icons/log_logo.png +0 -0
- PaIRS_UniNa/icons/logo_CalVi.png +0 -0
- PaIRS_UniNa/icons/logo_CalVi_completo.png +0 -0
- PaIRS_UniNa/icons/logo_CalVi_party.png +0 -0
- PaIRS_UniNa/icons/logo_PaIRS.png +0 -0
- PaIRS_UniNa/icons/logo_PaIRS_completo.png +0 -0
- PaIRS_UniNa/icons/logo_PaIRS_download.png +0 -0
- PaIRS_UniNa/icons/logo_PaIRS_party_rect.png +0 -0
- PaIRS_UniNa/icons/logo_PaIRS_rect.png +0 -0
- PaIRS_UniNa/icons/logo_opaco.png +0 -0
- PaIRS_UniNa/icons/mask.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/minus.png +0 -0
- PaIRS_UniNa/icons/mirror_u.png +0 -0
- PaIRS_UniNa/icons/mirror_v.png +0 -0
- PaIRS_UniNa/icons/mirror_x.png +0 -0
- PaIRS_UniNa/icons/mirror_y.png +0 -0
- PaIRS_UniNa/icons/mtplt.png +0 -0
- PaIRS_UniNa/icons/new.png +0 -0
- PaIRS_UniNa/icons/new_workspace.png +0 -0
- PaIRS_UniNa/icons/news.png +0 -0
- PaIRS_UniNa/icons/normal_run.png +0 -0
- PaIRS_UniNa/icons/open.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/pause.png +0 -0
- PaIRS_UniNa/icons/paused.png +0 -0
- PaIRS_UniNa/icons/pencil_bw.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/plane.png +0 -0
- PaIRS_UniNa/icons/play.png +0 -0
- PaIRS_UniNa/icons/plus.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/quit.png +0 -0
- PaIRS_UniNa/icons/read.png +0 -0
- PaIRS_UniNa/icons/read_list.png +0 -0
- PaIRS_UniNa/icons/redo.png +0 -0
- PaIRS_UniNa/icons/redx.png +0 -0
- PaIRS_UniNa/icons/reset.png +0 -0
- PaIRS_UniNa/icons/reset_levels.png +0 -0
- PaIRS_UniNa/icons/resize_icon.png +0 -0
- PaIRS_UniNa/icons/restore.png +0 -0
- PaIRS_UniNa/icons/restore_undo.png +0 -0
- PaIRS_UniNa/icons/rotate_clock.png +0 -0
- PaIRS_UniNa/icons/rotate_counter.png +0 -0
- PaIRS_UniNa/icons/rotate_v_clock.png +0 -0
- PaIRS_UniNa/icons/rotate_v_counter.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/sandglass.png +0 -0
- PaIRS_UniNa/icons/save.png +0 -0
- PaIRS_UniNa/icons/save_and_stop.png +0 -0
- PaIRS_UniNa/icons/save_cfg.png +0 -0
- PaIRS_UniNa/icons/saveas.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/spiv_setup_no.png +0 -0
- PaIRS_UniNa/icons/spiv_setup_ok.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/tom.png +0 -0
- PaIRS_UniNa/icons/trash.png +0 -0
- PaIRS_UniNa/icons/undo.png +0 -0
- PaIRS_UniNa/icons/unedited.png +0 -0
- PaIRS_UniNa/icons/unina_dii.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/up.png +0 -0
- PaIRS_UniNa/icons/updating_import.gif +0 -0
- PaIRS_UniNa/icons/updating_pairs.gif +0 -0
- PaIRS_UniNa/icons/vectorColor.png +0 -0
- PaIRS_UniNa/icons/vettore.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/waiting_circle.png +0 -0
- PaIRS_UniNa/icons/warning.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 +256 -0
- PaIRS_UniNa/parForMulti.py +435 -0
- PaIRS_UniNa/parForWorkers.py +593 -0
- PaIRS_UniNa/pivParFor.py +235 -0
- PaIRS_UniNa/plt_util.py +141 -0
- PaIRS_UniNa/preProcParFor.py +155 -0
- PaIRS_UniNa/procTools.py +1439 -0
- PaIRS_UniNa/readcfg.py +52 -0
- PaIRS_UniNa/rqrdpckgs.txt +9 -0
- PaIRS_UniNa/stereoPivParFor.py +227 -0
- PaIRS_UniNa/tAVarie.py +215 -0
- PaIRS_UniNa/tabSplitter.py +612 -0
- PaIRS_UniNa/ui_Calibration_Tab.py +578 -0
- PaIRS_UniNa/ui_Custom_Top.py +296 -0
- PaIRS_UniNa/ui_Input_Tab.py +1101 -0
- PaIRS_UniNa/ui_Input_Tab_CalVi.py +1283 -0
- PaIRS_UniNa/ui_Log_Tab.py +263 -0
- PaIRS_UniNa/ui_Output_Tab.py +2362 -0
- PaIRS_UniNa/ui_Process_Tab.py +3810 -0
- PaIRS_UniNa/ui_Process_Tab_CalVi.py +1549 -0
- PaIRS_UniNa/ui_Process_Tab_Disp.py +1141 -0
- PaIRS_UniNa/ui_Process_Tab_Min.py +437 -0
- PaIRS_UniNa/ui_ResizePopup.py +204 -0
- PaIRS_UniNa/ui_Vis_Tab.py +1628 -0
- PaIRS_UniNa/ui_Vis_Tab_CalVi.py +1251 -0
- PaIRS_UniNa/ui_Whatsnew.py +132 -0
- PaIRS_UniNa/ui_gPairs.py +877 -0
- PaIRS_UniNa/ui_infoPaIRS.py +551 -0
- PaIRS_UniNa/whatsnew.txt +4 -0
- pairs_unina-0.2.10.dist-info/METADATA +159 -0
- pairs_unina-0.2.10.dist-info/RECORD +333 -0
- pairs_unina-0.2.10.dist-info/WHEEL +5 -0
- pairs_unina-0.2.10.dist-info/top_level.txt +2 -0
PaIRS_UniNa/Input_Tab.py
ADDED
|
@@ -0,0 +1,829 @@
|
|
|
1
|
+
from .ui_Input_Tab import*
|
|
2
|
+
from .Input_Tab_tools import*
|
|
3
|
+
from .TabTools import*
|
|
4
|
+
|
|
5
|
+
spin_tips={
|
|
6
|
+
'inp_cam': 'Current camera number (import tool)',
|
|
7
|
+
'inp_ncam': 'Number of cameras (import tool)',
|
|
8
|
+
'ind_in': 'First image number',
|
|
9
|
+
'npairs': 'Number of image pairs',
|
|
10
|
+
'step': 'Step of image pairs',
|
|
11
|
+
'img': 'Current image pair number',
|
|
12
|
+
'cam': 'Current camera number',
|
|
13
|
+
'ncam': 'Number of cameras',
|
|
14
|
+
'frame': 'Current frame number',
|
|
15
|
+
}
|
|
16
|
+
check_tips={
|
|
17
|
+
'TR_Import': 'Time-resolved sequence',
|
|
18
|
+
}
|
|
19
|
+
radio_tips={}
|
|
20
|
+
line_edit_tips={
|
|
21
|
+
'path': 'Input folder path',
|
|
22
|
+
}
|
|
23
|
+
button_tips={
|
|
24
|
+
'data': 'Input data set',
|
|
25
|
+
'path': 'Input folder path',
|
|
26
|
+
'scan_path': 'Re-scan path',
|
|
27
|
+
'automatic_list': 'Automatic list setting',
|
|
28
|
+
'tool_CollapBox_ImSet': 'Open/Close image import tool',
|
|
29
|
+
'CollapBox_ImSet': 'Image import tool',
|
|
30
|
+
'automatic_frame': 'Automatic frame setting',
|
|
31
|
+
'example_list': 'Example list setting',
|
|
32
|
+
'import': 'Image set import',
|
|
33
|
+
'scan_list': 'Re-scan list',
|
|
34
|
+
'warning': 'Warning',
|
|
35
|
+
'cut_warnings': 'Cut items with warning',
|
|
36
|
+
'edit_list': 'Edit list',
|
|
37
|
+
'read_list': 'Read list image file',
|
|
38
|
+
'write_list': 'Write list image file',
|
|
39
|
+
'read': 'Read images from disk',
|
|
40
|
+
'sort': 'Sort images',
|
|
41
|
+
'sort_reversed': 'Reversly sort images',
|
|
42
|
+
'wrap_items': 'Expand items',
|
|
43
|
+
'unwrap_items': 'Collapse items',
|
|
44
|
+
'copy': 'Copy items',
|
|
45
|
+
'cut': 'Cut items',
|
|
46
|
+
'paste_below': 'Paste items below',
|
|
47
|
+
'paste_above': 'Paste items above',
|
|
48
|
+
'clean': 'Clean list',
|
|
49
|
+
'discard_changes': 'Discard changes',
|
|
50
|
+
'confirm_changes': 'Accept changes',
|
|
51
|
+
'up': 'Move to the top of the list',
|
|
52
|
+
'down': 'Move to the bottom of the list',
|
|
53
|
+
}
|
|
54
|
+
combo_tips={
|
|
55
|
+
'process': 'Type of process',
|
|
56
|
+
'frame_a': 'Pattern of pattern 1',
|
|
57
|
+
'frame_b': 'Pattern of pattern 2',
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
class INPpar(TABpar):
|
|
61
|
+
class ImportPar(TABpar):
|
|
62
|
+
def __init__(self,ncam=1):
|
|
63
|
+
self.setup(ncam)
|
|
64
|
+
self.OptionDone=0
|
|
65
|
+
super().__init__('INPpar','Input')
|
|
66
|
+
|
|
67
|
+
def setup(self,ncam=1):
|
|
68
|
+
self.frame_1 = [-1]*ncam
|
|
69
|
+
self.frame_2 = [-1]*ncam
|
|
70
|
+
self.inp_ncam = ncam
|
|
71
|
+
self.inp_cam = 1
|
|
72
|
+
self.ind_in = 0
|
|
73
|
+
self.npairs = 0
|
|
74
|
+
self.step = 1
|
|
75
|
+
self.FlagTR_Import = False
|
|
76
|
+
self.FlagImport = True
|
|
77
|
+
|
|
78
|
+
FlagAutoList = True
|
|
79
|
+
FlagAutoFrame = True
|
|
80
|
+
FlagExample = True
|
|
81
|
+
pathCompleter = basefold_DEBUGOptions
|
|
82
|
+
|
|
83
|
+
def __init__(self,Process=ProcessTypes.null,Step=StepTypes.null):
|
|
84
|
+
self.setup(Process,Step)
|
|
85
|
+
super().__init__('INPpar','Input')
|
|
86
|
+
self.importPar.copyfrom(self,exceptions=['name','surname'])
|
|
87
|
+
self.unchecked_fields+=['FlagCam','OptionValidPath','FlagAutoList','FlagAutoFrame','FlagExample',
|
|
88
|
+
'inp_cam','nExImTree','exImTreeExp','FlagImport','importPar',
|
|
89
|
+
'selection','FlagDone','pathCompleter'] #'FlagCollapBox'
|
|
90
|
+
|
|
91
|
+
def setup(self,Process,Step):
|
|
92
|
+
self.Process = Process
|
|
93
|
+
self.Step = Step
|
|
94
|
+
self.FlagCam = False
|
|
95
|
+
|
|
96
|
+
self.path = './'
|
|
97
|
+
self.OptionValidPath = 1
|
|
98
|
+
|
|
99
|
+
self.imSet = ImageSet()
|
|
100
|
+
|
|
101
|
+
#self.FlagCollapBox = True
|
|
102
|
+
self.frame_1 = [-1]
|
|
103
|
+
self.frame_2 = [-1]
|
|
104
|
+
self.inp_ncam = 3 if Process==ProcessTypes.tpiv else 2 if Process==ProcessTypes.spiv else 1
|
|
105
|
+
self.inp_cam = 1
|
|
106
|
+
self.ind_in = 0
|
|
107
|
+
self.npairs = 0
|
|
108
|
+
self.step = 1
|
|
109
|
+
self.FlagTR_Import = False
|
|
110
|
+
|
|
111
|
+
self.nExImTree = 3
|
|
112
|
+
self.exImTreeExp = [False]*self.nExImTree
|
|
113
|
+
self.exImList = [[[],[]]*self.inp_cam]
|
|
114
|
+
self.exImEx = [[[],[]]*self.inp_cam]
|
|
115
|
+
|
|
116
|
+
self.FlagImport = False
|
|
117
|
+
self.importPar = self.ImportPar(self.inp_ncam)
|
|
118
|
+
|
|
119
|
+
self.ncam = self.inp_ncam
|
|
120
|
+
self.imList = [[[],[]] for _ in range(self.ncam)]
|
|
121
|
+
self.imEx = [[[],[]] for _ in range(self.ncam)]
|
|
122
|
+
self.nimg = 0
|
|
123
|
+
self.selection = [0,0,0]
|
|
124
|
+
|
|
125
|
+
self.FlagMIN = Step==StepTypes.min
|
|
126
|
+
self.FlagTR = False
|
|
127
|
+
self.LaserType = 0
|
|
128
|
+
self.imListMin = [[[],[]] for _ in range(self.ncam)]
|
|
129
|
+
|
|
130
|
+
self.FlagCAL = Process in ProcessTypes.threeCameras
|
|
131
|
+
self.calList = []
|
|
132
|
+
self.calEx = []
|
|
133
|
+
|
|
134
|
+
#self.FlagDISP = Step==StepTypes.disp
|
|
135
|
+
#self.dispFile = ''
|
|
136
|
+
|
|
137
|
+
class Input_Tab(gPaIRS_Tab):
|
|
138
|
+
class Import_Tab_Signals(gPaIRS_Tab.Tab_Signals):
|
|
139
|
+
tooltipRequested = Signal(str)
|
|
140
|
+
pass
|
|
141
|
+
|
|
142
|
+
def __init__(self,parent: QWidget =None, flagInit= __name__ == "__main__"):
|
|
143
|
+
pri.Time.yellow('Input: init')
|
|
144
|
+
super().__init__(parent,Ui_InputTab,INPpar)
|
|
145
|
+
self.signals=self.Import_Tab_Signals(self)
|
|
146
|
+
pri.Time.yellow('Input: ui')
|
|
147
|
+
|
|
148
|
+
#------------------------------------- Graphical interface: widgets
|
|
149
|
+
self.TABname='Input'
|
|
150
|
+
self.ui: Ui_InputTab
|
|
151
|
+
self.exImTree=self.ui.exImTree=GlobalImageTree(self,FlagNum=True)
|
|
152
|
+
self.exImTree.setVerticalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
|
153
|
+
self.exImTree.setHorizontalScrollBarPolicy(Qt.ScrollBarPolicy.ScrollBarAlwaysOff)
|
|
154
|
+
self.exImTree.setSelectionBehavior(QTreeWidget.SelectionBehavior.SelectRows)
|
|
155
|
+
#self.exImTree.setHeaderHidden(True)
|
|
156
|
+
self.exImTree.header().setVisible(True)
|
|
157
|
+
self.hbarExImTree = QScrollBar(Qt.Horizontal)
|
|
158
|
+
self.hbarExImTree.setStyleSheet("""
|
|
159
|
+
QScrollBar::handle:horizontal {
|
|
160
|
+
min-width: 40px;
|
|
161
|
+
}
|
|
162
|
+
""")
|
|
163
|
+
self.exImTree.setVisible(True)
|
|
164
|
+
self.hbarExImTree.setVisible(True)
|
|
165
|
+
# Sync ranges and values
|
|
166
|
+
origHbar = self.exImTree.horizontalScrollBar()
|
|
167
|
+
origHbar.rangeChanged.connect(self.hbarExImTree.setRange)
|
|
168
|
+
origHbar.valueChanged.connect(self.hbarExImTree.setValue)
|
|
169
|
+
self.hbarExImTree.valueChanged.connect(origHbar.setValue)
|
|
170
|
+
# Layout
|
|
171
|
+
self.containerExImTree = QWidget()
|
|
172
|
+
layoutExImTree = QVBoxLayout(self.containerExImTree)
|
|
173
|
+
layoutExImTree.setContentsMargins(0,0,0,0)
|
|
174
|
+
layoutExImTree.setSpacing(0)
|
|
175
|
+
layoutExImTree.addWidget(self.exImTree)
|
|
176
|
+
layoutExImTree.addWidget(self.hbarExImTree)
|
|
177
|
+
self.ui.g_ImSet_layout.insertWidget(2,self.containerExImTree)
|
|
178
|
+
|
|
179
|
+
#necessary to change the name and the order of the items
|
|
180
|
+
for g in list(globals()):
|
|
181
|
+
if '_items' in g or '_ord' in g or '_tips' in g:
|
|
182
|
+
#pri.Info.blue(f'Adding {g} to {self.name_tab}')
|
|
183
|
+
setattr(self,g,eval(g))
|
|
184
|
+
|
|
185
|
+
if __name__ == "__main__":
|
|
186
|
+
self.app=app
|
|
187
|
+
setAppGuiPalette(self)
|
|
188
|
+
|
|
189
|
+
#------------------------------------- Graphical interface: miscellanea
|
|
190
|
+
self.pixmap_x = QPixmap(''+ icons_path +'redx.png')
|
|
191
|
+
self.pixmap_v = QPixmap(''+ icons_path +'greenv.png')
|
|
192
|
+
self.pixmap_wait = QPixmap(''+ icons_path +'sandglass.png')
|
|
193
|
+
self.pixmap_warn = QPixmap(u""+ icons_path +"warning.png")
|
|
194
|
+
|
|
195
|
+
self.signals.tooltipRequested.connect(self.show_import_tooltip)
|
|
196
|
+
|
|
197
|
+
#------------------------------------- Declaration of parameters
|
|
198
|
+
self.INPpar_base=INPpar()
|
|
199
|
+
self.INPpar:INPpar=self.TABpar
|
|
200
|
+
self.INPpar_old:INPpar=self.TABpar_old
|
|
201
|
+
|
|
202
|
+
pri.Time.yellow('Input: setupWid and par')
|
|
203
|
+
|
|
204
|
+
#------------------------------------- Callbacks
|
|
205
|
+
self.defineWidgets()
|
|
206
|
+
self.setupWid() #---------------- IMPORTANT
|
|
207
|
+
|
|
208
|
+
self.defineCallbacks()
|
|
209
|
+
self.connectCallbacks()
|
|
210
|
+
self.defineFurtherCallbacks()
|
|
211
|
+
|
|
212
|
+
self.defineSettings()
|
|
213
|
+
self.TABsettings.append(self.image_list_set)
|
|
214
|
+
#self.TABsettings.append(self.button_box_set)
|
|
215
|
+
|
|
216
|
+
self.adjustTABpar=self.adjustINPpar
|
|
217
|
+
self.setTABlayout=self.setINPlayout
|
|
218
|
+
self.checkTABpar=lambda ind: self.checkINPpar(ind,FlagRescan=True)
|
|
219
|
+
self.setTABwarn=self.setINPwarn
|
|
220
|
+
self.disableTab=self.disableInputTab
|
|
221
|
+
|
|
222
|
+
self.ImTreeInd=[]
|
|
223
|
+
self.ui.imTreeWidget.imTree.signals.stopWorker.connect(self.emptyImTreeInd)
|
|
224
|
+
self.ui.imTreeWidget.FlagInGui=True
|
|
225
|
+
|
|
226
|
+
self.FlagScanPath=False
|
|
227
|
+
pri.Time.yellow('Input: define callbacks')
|
|
228
|
+
|
|
229
|
+
#------------------------------------- Initializing
|
|
230
|
+
if flagInit:
|
|
231
|
+
self.initialize()
|
|
232
|
+
#else:
|
|
233
|
+
# self.setTABpar(FlagBridge=False)
|
|
234
|
+
|
|
235
|
+
def defineFurtherCallbacks(self):
|
|
236
|
+
self.ui.button_data.clicked.connect(lambda: downloadExampleData(self,'https://www.pairs.unina.it/web/PIV_data.zip'))
|
|
237
|
+
|
|
238
|
+
#self.button_box_callback=self.wrappedCallback('Open/close Image import tool box',self.button_box_action)
|
|
239
|
+
#self.ui.CollapBox_ImSet.toggle_button.clicked.connect(self.button_box_callback)
|
|
240
|
+
self.ui.spin_inp_cam.valueChanged.connect(self.spin_inp_cam_callback)
|
|
241
|
+
self.ui.spin_inp_cam.addfuncout={}
|
|
242
|
+
itemExpansion_callback=self.wrappedCallback('Item expanded/collapsed',self.itemExpandedCollapsed)
|
|
243
|
+
self.exImTree.itemExpanded.connect(itemExpansion_callback)
|
|
244
|
+
self.exImTree.itemCollapsed.connect(itemExpansion_callback)
|
|
245
|
+
|
|
246
|
+
self.image_list_callback=self.wrappedCallback('Image list change',self.image_list_action)
|
|
247
|
+
self.ui.imTreeWidget.imTrees[0].signals.updateLists.connect(self.image_list_callback)
|
|
248
|
+
#self.selection_callback=self.wrappedCallback('Image list change',self.selection_action)
|
|
249
|
+
self.selection_callback=self.selection_action
|
|
250
|
+
self.ui.imTreeWidget.spin_img.valueChanged.connect(self.selection_callback)
|
|
251
|
+
self.ui.imTreeWidget.spin_cam.valueChanged.connect(self.selection_callback)
|
|
252
|
+
self.ui.imTreeWidget.spin_frame.valueChanged.connect(self.selection_callback)
|
|
253
|
+
self.ui.imTreeWidget.signals.selection.connect(self.selection_callback)
|
|
254
|
+
|
|
255
|
+
def initialize(self):
|
|
256
|
+
pri.Info.yellow(f'{"*"*20} INPUT initialization {"*"*20}')
|
|
257
|
+
from .PaIRS_pypacks import basefold
|
|
258
|
+
#self.ui.imTreeWidget.nullList()
|
|
259
|
+
self.INPpar.Process=ProcessTypes.piv
|
|
260
|
+
self.INPpar.path=basefold_DEBUG if __name__ == "__main__" else basefold
|
|
261
|
+
self.INPpar.imSet.path=self.INPpar.path
|
|
262
|
+
#self.cleanPrevs(self.INPpar.ind,FlagAllPrev=True)
|
|
263
|
+
self.ui.line_edit_path.setText(self.INPpar.path)
|
|
264
|
+
self.line_edit_path_callback()
|
|
265
|
+
|
|
266
|
+
#*************************************************** Adjusting parameters
|
|
267
|
+
def adjustINPpar(self):
|
|
268
|
+
self.INPpar.FlagCam=self.INPpar.Process in ProcessTypes.threeCameras
|
|
269
|
+
if not self.INPpar.FlagCam:
|
|
270
|
+
self.INPpar.inp_ncam=self.INPpar.ncam=self.ncamMinimum()
|
|
271
|
+
else:
|
|
272
|
+
self.INPpar.inp_ncam=self.INPpar.ncam=max([self.INPpar.inp_ncam,self.ncamMinimum()])
|
|
273
|
+
self.INPpar.inp_cam=min([self.INPpar.inp_cam,self.INPpar.inp_ncam])
|
|
274
|
+
if self.INPpar.inp_ncam<self.INPpar_old.inp_ncam:
|
|
275
|
+
del self.INPpar.frame_1[self.INPpar.inp_ncam:]
|
|
276
|
+
del self.INPpar.frame_2[self.INPpar.inp_ncam:]
|
|
277
|
+
elif self.INPpar.inp_ncam>self.INPpar_old.inp_ncam:
|
|
278
|
+
frame_1,frame_2=self.automaticFrames()
|
|
279
|
+
self.INPpar.frame_1[self.INPpar_old.inp_ncam:self.INPpar.inp_ncam]=frame_1[self.INPpar_old.inp_ncam:self.INPpar.inp_ncam]
|
|
280
|
+
self.INPpar.frame_2[self.INPpar_old.inp_ncam:self.INPpar.inp_ncam]=frame_2[self.INPpar_old.inp_ncam:self.INPpar.inp_ncam]
|
|
281
|
+
if len(self.INPpar.frame_1)<self.INPpar.inp_ncam:
|
|
282
|
+
self.INPpar.frame_1+=[self.INPpar.frame_1[0]]*(self.INPpar.inp_ncam-len(self.INPpar.frame_1))
|
|
283
|
+
self.INPpar.frame_2+=[self.INPpar.frame_2[0]]*(self.INPpar.inp_ncam-len(self.INPpar.frame_2))
|
|
284
|
+
#if self.INPpar.isDifferentFrom(self.INPpar_old,fields=['path']):
|
|
285
|
+
|
|
286
|
+
self.INPpar.path=myStandardPath(self.INPpar.path)
|
|
287
|
+
self.INPpar.nimg=0
|
|
288
|
+
if len(self.INPpar.imList[0]):
|
|
289
|
+
if len(self.INPpar.imList[0][0]):
|
|
290
|
+
self.INPpar.nimg=len(self.INPpar.imList[0][0])
|
|
291
|
+
self.checkINPpar(FlagRescan=True)
|
|
292
|
+
if not self.INPpar.OptionValidPath or not self.INPpar.imSet.count: INPpar.FlagExample=False
|
|
293
|
+
self.adjustExampleImageList()
|
|
294
|
+
self.INPpar.FlagImport=self.INPpar.importPar.FlagImport and self.INPpar.importPar.isEqualTo(self.INPpar,exceptions=['name','surname','FlagImport','ind'])
|
|
295
|
+
|
|
296
|
+
#self.INPpar.importPar.printDifferences(self.INPpar,exceptions=['name','surname','FlagImport','ind'],FlagStrictDiff=True)
|
|
297
|
+
return
|
|
298
|
+
|
|
299
|
+
def checkINPpar(self,ind=None,FlagRescan=False): #FlagRescan=False):
|
|
300
|
+
if ind is None: INP:INPpar=self.INPpar
|
|
301
|
+
else: INP:INPpar=self.TABpar_at(ind)
|
|
302
|
+
self.setOptionValidPath(ind)
|
|
303
|
+
FlagWarn=INP.OptionValidPath==0
|
|
304
|
+
if not INP.FlagInit or FlagRescan:
|
|
305
|
+
self.scanImList(ind)
|
|
306
|
+
if not FlagWarn:
|
|
307
|
+
for imExc in INP.imEx:
|
|
308
|
+
for imExf in imExc:
|
|
309
|
+
for ex in imExf:
|
|
310
|
+
if not ex:
|
|
311
|
+
FlagWarn=True
|
|
312
|
+
break
|
|
313
|
+
INP.OptionDone=1 if (len(INP.imList[0][0])>0 and not FlagWarn) else 0 #-1 if len(INP.imList[0][0])>0 else 0
|
|
314
|
+
|
|
315
|
+
def scanImList(self,ind=None):
|
|
316
|
+
if ind: INP:INPpar=self.TABpar_at(ind)
|
|
317
|
+
else: INP:INPpar=self.INPpar
|
|
318
|
+
FlagWarning=False
|
|
319
|
+
for c in range(len(INP.imList)): #INP.ncam
|
|
320
|
+
for f in range(2):
|
|
321
|
+
for k in range(len(INP.imList[0][0])): #INP.nimg
|
|
322
|
+
#ex=INP.imEx[c][f][k]
|
|
323
|
+
INP.imEx[c][f][k]=os.path.exists(INP.path+INP.imList[c][f][k]) if INP.imList[c][f][k] else False
|
|
324
|
+
if not FlagWarning and not INP.imEx[c][f][k]: FlagWarning=True
|
|
325
|
+
return FlagWarning
|
|
326
|
+
|
|
327
|
+
def purgeImList(self, ind=None):
|
|
328
|
+
"""Drop every k where any INP.imEx[c][f][k] is False; remove k from both imEx and imList across all c,f."""
|
|
329
|
+
INP = self.INPpar if ind is None else self.TABpar_at(ind)
|
|
330
|
+
if not hasattr(INP,"imEx") or not hasattr(INP,"imList"): return 0
|
|
331
|
+
|
|
332
|
+
# Collect all k to drop if False appears anywhere at that k
|
|
333
|
+
ks_to_drop=set()
|
|
334
|
+
for c in range(len(INP.imEx)):
|
|
335
|
+
for f in range(len(INP.imEx[c])):
|
|
336
|
+
row=INP.imEx[c][f]
|
|
337
|
+
for k, ex in enumerate(row):
|
|
338
|
+
if not ex: ks_to_drop.add(k)
|
|
339
|
+
|
|
340
|
+
if not ks_to_drop: return 0
|
|
341
|
+
ks_sorted=sorted(ks_to_drop, reverse=True)
|
|
342
|
+
|
|
343
|
+
# Delete k across all c,f for both imEx and imList (bounds-checked, ragged-safe)
|
|
344
|
+
for c in range(len(INP.imEx)):
|
|
345
|
+
for f in range(len(INP.imEx[c])):
|
|
346
|
+
for k in ks_sorted:
|
|
347
|
+
if k < len(INP.imEx[c][f]): del INP.imEx[c][f][k]
|
|
348
|
+
if c < len(INP.imList) and f < len(INP.imList[c]) and k < len(INP.imList[c][f]):
|
|
349
|
+
del INP.imList[c][f][k]
|
|
350
|
+
return len(ks_to_drop)
|
|
351
|
+
|
|
352
|
+
#*************************************************** Layout
|
|
353
|
+
def setINPlayout(self):
|
|
354
|
+
self.ui.label_process.setVisible(__name__ == "__main__")
|
|
355
|
+
self.ui.combo_process.setVisible(__name__ == "__main__")
|
|
356
|
+
self.setPathLabel()
|
|
357
|
+
self.setPathCompleter()
|
|
358
|
+
|
|
359
|
+
self.ui.g_ImSet.setEnabled(self.INPpar.OptionValidPath and self.INPpar.imSet.count)
|
|
360
|
+
#if self.INPpar.imSet.isDifferentFrom(self.INPpar_old.imSet,fields=['pattern']):
|
|
361
|
+
self.ui.combo_frame_a.clear()
|
|
362
|
+
self.ui.combo_frame_a.addItems(self.INPpar.imSet.pattern)
|
|
363
|
+
self.ui.combo_frame_b.clear()
|
|
364
|
+
self.ui.combo_frame_b.addItems(['-']+self.INPpar.imSet.pattern)
|
|
365
|
+
|
|
366
|
+
self.ui.spin_inp_ncam.setEnabled(self.INPpar.FlagCam)
|
|
367
|
+
self.ui.spin_inp_ncam.setMinimum(self.ncamMinimum())
|
|
368
|
+
self.ui.imTreeWidget.spin_ncam.setEnabled(False)
|
|
369
|
+
self.ui.imTreeWidget.FlagCam=self.INPpar.FlagCam
|
|
370
|
+
self.ui.imTreeWidget.spin_ncam.setMinimum(self.ncamMinimum())
|
|
371
|
+
self.ui.imTreeWidget.spin_ncam.setValue(self.INPpar.importPar.inp_ncam)
|
|
372
|
+
self.ui.spin_inp_cam.setEnabled(self.INPpar.inp_ncam>1)
|
|
373
|
+
self.ui.spin_inp_cam.setMaximum(self.INPpar.inp_ncam)
|
|
374
|
+
self.setImageNumberSpinLimits()
|
|
375
|
+
self.containerExImTree.setVisible(INPpar.FlagExample)
|
|
376
|
+
self.layoutExampleImageList()
|
|
377
|
+
#self.ui.button_import.setEnabled(not self.INPpar.FlagImport)
|
|
378
|
+
|
|
379
|
+
"""
|
|
380
|
+
if self.INPpar.ind[-1]<len(self.TABpar_prev_at(self.INPpar.ind))-1:
|
|
381
|
+
self.ui.imTreeWidget.w_button.setVisible(False)
|
|
382
|
+
else:
|
|
383
|
+
self.ui.imTreeWidget.w_button.setVisible(True)
|
|
384
|
+
"""
|
|
385
|
+
|
|
386
|
+
self.checkINPpar(FlagRescan=False)
|
|
387
|
+
self.setINPwarn()
|
|
388
|
+
self.setTABWarnLabel()
|
|
389
|
+
return
|
|
390
|
+
|
|
391
|
+
def setINPwarn(self,ind=None):
|
|
392
|
+
if ind is None: INP:INPpar=self.INPpar
|
|
393
|
+
else: INP:INPpar=self.TABpar_at(ind)
|
|
394
|
+
if INP.OptionDone==1:
|
|
395
|
+
INP.warningMessage='Input image files correctly identified!'
|
|
396
|
+
else:
|
|
397
|
+
FlagWarn=False
|
|
398
|
+
for imExc in INP.imEx:
|
|
399
|
+
for imExf in imExc:
|
|
400
|
+
for ex in imExf:
|
|
401
|
+
if not ex:
|
|
402
|
+
FlagWarn=True
|
|
403
|
+
break
|
|
404
|
+
if INP.OptionValidPath==0:
|
|
405
|
+
INP.warningMessage='Invalid input path!'
|
|
406
|
+
elif len(INP.imList[0][0])==0:
|
|
407
|
+
INP.warningMessage='Image set empty!'
|
|
408
|
+
elif FlagWarn:
|
|
409
|
+
INP.warningMessage='Some image files missing!'
|
|
410
|
+
else:
|
|
411
|
+
INP.warningMessage='Issues with identifying input image files!'
|
|
412
|
+
|
|
413
|
+
def ncamMinimum(self):
|
|
414
|
+
return 3 if self.INPpar.Process==ProcessTypes.tpiv else 2 if self.INPpar.Process==ProcessTypes.spiv else 1
|
|
415
|
+
|
|
416
|
+
def disableInputTab(self,flag):
|
|
417
|
+
self.setEnabled(not flag)
|
|
418
|
+
|
|
419
|
+
#*************************************************** Mode
|
|
420
|
+
#******************** Actions
|
|
421
|
+
def combo_process_action(self):
|
|
422
|
+
current_ind=self.ui.combo_process.currentIndex()
|
|
423
|
+
self.INPpar.Process=list(process)[current_ind]
|
|
424
|
+
if self.INPpar.Process in ProcessTypes.threeCameras:
|
|
425
|
+
self.INPpar.ncam=self.INPpar.inp_ncam=max([self.INPpar.ncam,self.ncamMinimum()])
|
|
426
|
+
else:
|
|
427
|
+
self.INPpar.ncam=self.INPpar.inp_ncam=self.ncamMinimum()
|
|
428
|
+
|
|
429
|
+
if INPpar.FlagAutoList:
|
|
430
|
+
self.button_scan_path_action()
|
|
431
|
+
else:
|
|
432
|
+
self.ui.imTreeWidget.spin_ncam.setMinimum(self.ncamMinimum())
|
|
433
|
+
self.ui.imTreeWidget.spin_ncam.setValue(self.INPpar.ncam)
|
|
434
|
+
self.INPpar.imList=self.ui.imTreeWidget.imTree.imList
|
|
435
|
+
self.INPpar.imEx=self.ui.imTreeWidget.imTree.imEx
|
|
436
|
+
self.ui.imTreeWidget.spin_ncam_action()
|
|
437
|
+
return
|
|
438
|
+
|
|
439
|
+
#******************** Set
|
|
440
|
+
def combo_process_set(self):
|
|
441
|
+
current_proc=process[self.INPpar.Process]
|
|
442
|
+
self.ui.combo_process.setCurrentIndex(process_items.index(current_proc))
|
|
443
|
+
|
|
444
|
+
#*************************************************** Path
|
|
445
|
+
#******************** Actions
|
|
446
|
+
def line_edit_path_changing(self):
|
|
447
|
+
self.ui.label_check_path.setPixmap(QPixmap())
|
|
448
|
+
|
|
449
|
+
def line_edit_path_preaction(self):
|
|
450
|
+
currpath=myStandardPath(self.ui.line_edit_path.text())
|
|
451
|
+
self.FlagScanPath=os.path.normpath(self.INPpar.path)!=currpath
|
|
452
|
+
currpath=relativizePath(currpath)
|
|
453
|
+
if os.path.exists(currpath) and currpath!='./':
|
|
454
|
+
pathCompleter=INPpar.pathCompleter #self.INPpar.pathCompleter
|
|
455
|
+
if currpath in pathCompleter: pathCompleter.remove(currpath)
|
|
456
|
+
pathCompleter.insert(0,currpath)
|
|
457
|
+
if len(pathCompleter)>pathCompleterLength:
|
|
458
|
+
INPpar.pathCompleter=pathCompleter[:pathCompleterLength]
|
|
459
|
+
self.ui.line_edit_path.setText(currpath)
|
|
460
|
+
|
|
461
|
+
def line_edit_path_action_future(self):
|
|
462
|
+
if self.FlagScanPath:
|
|
463
|
+
self.button_scan_path_action()
|
|
464
|
+
|
|
465
|
+
def button_path_action(self):
|
|
466
|
+
directory = str(QFileDialog.getExistingDirectory(self,\
|
|
467
|
+
"Choose an input folder", dir=self.INPpar.path,options=optionNativeDialog))
|
|
468
|
+
currpath='{}'.format(directory)
|
|
469
|
+
if not currpath=='':
|
|
470
|
+
currpath=myStandardPath(currpath)
|
|
471
|
+
self.ui.line_edit_path.setText(currpath)
|
|
472
|
+
self.INPpar.path=self.ui.line_edit_path.text()
|
|
473
|
+
self.line_edit_path_preaction()
|
|
474
|
+
else:
|
|
475
|
+
currpath='./'
|
|
476
|
+
|
|
477
|
+
def button_path_action_future(self):
|
|
478
|
+
self.line_edit_path_action_future()
|
|
479
|
+
|
|
480
|
+
def button_scan_path_action(self):
|
|
481
|
+
self.scanInputPath()
|
|
482
|
+
if INPpar.FlagAutoList:
|
|
483
|
+
self.button_import_action()
|
|
484
|
+
else:
|
|
485
|
+
self.ui.imTreeWidget.imTree.path=self.INPpar.path
|
|
486
|
+
self.ui.imTreeWidget.imTree.scanLists()
|
|
487
|
+
self.INPpar.imEx=self.ui.imTreeWidget.imTree.imEx
|
|
488
|
+
|
|
489
|
+
def scanInputPath(self,ind=None,patterns=None,FlagNoWarning=True):
|
|
490
|
+
INP = self.INPpar if ind is None else self.TABpar_at(ind)
|
|
491
|
+
INP.imSet.scanPath(INP.path)
|
|
492
|
+
ncam = INP.inp_ncam
|
|
493
|
+
|
|
494
|
+
FlagAutomaticFrames=True
|
|
495
|
+
if patterns and len(patterns)==2 and INP.imSet.count:
|
|
496
|
+
A,B = patterns # lists of patterns (len <= ncam)
|
|
497
|
+
INP.frame_1 = [-1]*ncam
|
|
498
|
+
INP.frame_2 = [-1]*ncam
|
|
499
|
+
|
|
500
|
+
# Build first-occurrence lookup: pattern -> index in slave's INP.imSet.pattern
|
|
501
|
+
pat_list = getattr(INP.imSet, "pattern", [])
|
|
502
|
+
idx_map = {}
|
|
503
|
+
for idx,p in enumerate(pat_list):
|
|
504
|
+
if p not in idx_map: idx_map[p]=idx
|
|
505
|
+
|
|
506
|
+
# Assign frames by matching patterns; leave -1 if not found
|
|
507
|
+
def _assign(dst, src, ind0=0):
|
|
508
|
+
for k in range(ncam):
|
|
509
|
+
key = src[k] if k < len(src) else None
|
|
510
|
+
dst[k] = idx_map.get(key, -1)
|
|
511
|
+
if ind0 and key is not None: dst[k]+=ind0
|
|
512
|
+
|
|
513
|
+
_assign(INP.frame_1, A)
|
|
514
|
+
_assign(INP.frame_2, B, 1)
|
|
515
|
+
|
|
516
|
+
valid=any(f>-1 for f in INP.frame_1) or any(f>0 for f in INP.frame_2)
|
|
517
|
+
if not valid and FlagNoWarning:
|
|
518
|
+
FlagAutomaticFrames = True
|
|
519
|
+
else:
|
|
520
|
+
FlagAutomaticFrames = False
|
|
521
|
+
|
|
522
|
+
if FlagAutomaticFrames:
|
|
523
|
+
if INP.imSet.count:
|
|
524
|
+
INP.frame_1[0]=0
|
|
525
|
+
INP.frame_1,INP.frame_2=self.automaticFrames(ind)
|
|
526
|
+
else:
|
|
527
|
+
INP.frame_1=[-1]*INP.inp_ncam
|
|
528
|
+
INP.frame_2=[-1]*INP.inp_ncam
|
|
529
|
+
# Update derived indices and safety on step
|
|
530
|
+
INP.ind_in, _, INP.npairs, _= self.getIndNpairs(ind)
|
|
531
|
+
if INP.npairs<1: INP.step=1
|
|
532
|
+
|
|
533
|
+
def automaticFrames(self,ind=None):
|
|
534
|
+
INP = self.INPpar if ind is None else self.TABpar_at(ind)
|
|
535
|
+
cam=INP.inp_cam-1
|
|
536
|
+
if not INP.imSet.nimg:
|
|
537
|
+
return INP.frame_1,INP.frame_2
|
|
538
|
+
f1=INP.frame_1[cam]
|
|
539
|
+
link1=INP.imSet.link[f1]
|
|
540
|
+
nlink1=len(link1)
|
|
541
|
+
frame_1=[f1]*INP.inp_ncam
|
|
542
|
+
frame_2=[f1+1]*INP.inp_ncam
|
|
543
|
+
frame_2[0]=link1[0]+1 if link1[0]!=f1 else 0
|
|
544
|
+
for c in range(1,INP.inp_ncam):
|
|
545
|
+
flagValid=c<nlink1-1
|
|
546
|
+
frame_1[c]=f1c=link1[c] if flagValid else -1
|
|
547
|
+
frame_2[c]=INP.imSet.link[f1c][0]+1 if flagValid else -1
|
|
548
|
+
if cam:
|
|
549
|
+
frame_1=frame_1[-cam:]+frame_1[:-cam]
|
|
550
|
+
frame_2=frame_2[-cam:]+frame_2[:-cam]
|
|
551
|
+
return frame_1, frame_2
|
|
552
|
+
|
|
553
|
+
def button_automatic_list_action(self):
|
|
554
|
+
INPpar.FlagAutoList=self.ui.button_automatic_list.isChecked()
|
|
555
|
+
return True
|
|
556
|
+
|
|
557
|
+
#******************** Settings
|
|
558
|
+
def setOptionValidPath(self,ind=None):
|
|
559
|
+
if ind is None: INP:INPpar=self.INPpar
|
|
560
|
+
else: INP:INPpar=self.TABpar_at(ind)
|
|
561
|
+
INP.OptionValidPath=int(os.path.exists(INP.path))
|
|
562
|
+
return
|
|
563
|
+
|
|
564
|
+
def setPathCompleter(self):
|
|
565
|
+
self.edit_path_completer=QCompleter(self.INPpar.pathCompleter)
|
|
566
|
+
self.edit_path_completer.setCompletionMode(QCompleter.CompletionMode(1))
|
|
567
|
+
self.edit_path_completer.setModelSorting(QCompleter.ModelSorting(2))
|
|
568
|
+
self.edit_path_completer.setWidget(self.ui.line_edit_path)
|
|
569
|
+
if self.INPpar.path in self.INPpar.pathCompleter:
|
|
570
|
+
k=self.INPpar.pathCompleter.index(self.INPpar.path)
|
|
571
|
+
self.edit_path_completer.setCurrentRow(k)
|
|
572
|
+
self.ui.line_edit_path.setCompleter(self.edit_path_completer)
|
|
573
|
+
self.ui.line_edit_path.FlagCompleter=True
|
|
574
|
+
|
|
575
|
+
def button_automatic_list_set(self):
|
|
576
|
+
self.ui.button_automatic_list.setChecked(INPpar.FlagAutoList)
|
|
577
|
+
|
|
578
|
+
#******************** Layout
|
|
579
|
+
def setPathLabel(self):
|
|
580
|
+
#Clickable label: no need for setStatusTip
|
|
581
|
+
if self.INPpar.OptionValidPath==1:
|
|
582
|
+
self.ui.label_check_path.setPixmap(self.pixmap_v)
|
|
583
|
+
self.ui.label_check_path.setToolTip("The specified path of the input folder exists!")
|
|
584
|
+
elif self.INPpar.OptionValidPath==0:
|
|
585
|
+
self.ui.label_check_path.setPixmap(self.pixmap_x)
|
|
586
|
+
self.ui.label_check_path.setToolTip("The specified path of the input folder does not exist!")
|
|
587
|
+
elif self.INPpar.OptionValidPath==-10:
|
|
588
|
+
self.ui.label_check_path.setPixmap(self.pixmap_wait)
|
|
589
|
+
self.ui.label_check_path.setToolTip("The specified path of the input folder is currently under inspection!")
|
|
590
|
+
|
|
591
|
+
#*************************************************** Image import tool
|
|
592
|
+
#******************** Actions
|
|
593
|
+
"""
|
|
594
|
+
def button_box_action(self):
|
|
595
|
+
self.INPpar.FlagCollapBox=self.ui.CollapBox_ImSet.toggle_button.isChecked()
|
|
596
|
+
return True
|
|
597
|
+
"""
|
|
598
|
+
|
|
599
|
+
def button_automatic_frame_action(self):
|
|
600
|
+
INPpar.FlagAutoFrame=self.ui.button_automatic_frame.isChecked()
|
|
601
|
+
return True
|
|
602
|
+
|
|
603
|
+
def combo_frame_a_action(self):
|
|
604
|
+
self.INPpar.frame_1[self.INPpar.inp_cam-1]=self.ui.combo_frame_a.currentIndex()
|
|
605
|
+
if INPpar.FlagAutoFrame:
|
|
606
|
+
self.INPpar.frame_1,self.INPpar.frame_2=self.automaticFrames()
|
|
607
|
+
self.INPpar.ind_in, _, self.INPpar.npairs, _= self.getIndNpairs()
|
|
608
|
+
|
|
609
|
+
def combo_frame_b_action(self):
|
|
610
|
+
self.INPpar.frame_2[self.INPpar.inp_cam-1]=self.ui.combo_frame_b.currentIndex()
|
|
611
|
+
|
|
612
|
+
def button_example_list_action(self):
|
|
613
|
+
INPpar.FlagExample=self.ui.button_example_list.isChecked()
|
|
614
|
+
self.layoutExampleImageList()
|
|
615
|
+
self.containerExImTree.setVisible(INPpar.FlagExample)
|
|
616
|
+
return True
|
|
617
|
+
|
|
618
|
+
def spin_inp_cam_action(self):
|
|
619
|
+
if INPpar.FlagExample:
|
|
620
|
+
items=[self.exImTree.topLevelItem(0)] if not self.exImTree.selectedItems() else self.exImTree.selectedItems()
|
|
621
|
+
self.exImTree.clearSelection()
|
|
622
|
+
for item in items:
|
|
623
|
+
if item.parent(): item=item.parent()
|
|
624
|
+
if self.INPpar.inp_cam-1:
|
|
625
|
+
if not item.isExpanded():
|
|
626
|
+
self.INPpar.exImTreeExp[self.exImTree.indexOfTopLevelItem(item)]=True
|
|
627
|
+
item=item.child(self.INPpar.inp_cam-2)
|
|
628
|
+
item.setSelected(True)
|
|
629
|
+
|
|
630
|
+
def button_import_action(self):
|
|
631
|
+
self.INPpar.imList,self.INPpar.imEx=self.INPpar.imSet.genListsFromFrame(self.INPpar.frame_1,self.INPpar.frame_2,self.INPpar.ind_in,self.INPpar.npairs,self.INPpar.step,self.INPpar.FlagTR_Import)
|
|
632
|
+
if self.INPpar.isDifferentFrom(self.INPpar_old,fields=['imList','imEx']):
|
|
633
|
+
INPpar.FlagExample=False
|
|
634
|
+
self.INPpar.selection=[1,1,1]
|
|
635
|
+
self.InputAdjustSelection()
|
|
636
|
+
self.INPpar.FlagImport=True
|
|
637
|
+
self.INPpar.importPar.copyfrom(self.INPpar,exceptions=['name','surname'])
|
|
638
|
+
self.ui.CollapBox_ImSet.toggle_button.click()
|
|
639
|
+
self.ui.imTreeWidget.setFocus()
|
|
640
|
+
else:
|
|
641
|
+
# --- Tooltip warning ---
|
|
642
|
+
msg = "No changes to be applied to the image list!"
|
|
643
|
+
self.signals.tooltipRequested.emit(msg) # thread-safe
|
|
644
|
+
|
|
645
|
+
@Slot(str)
|
|
646
|
+
def show_import_tooltip(self, msg: str):
|
|
647
|
+
show_mouse_tooltip(self,msg)
|
|
648
|
+
|
|
649
|
+
#******************** Settings
|
|
650
|
+
"""
|
|
651
|
+
def button_box_set(self):
|
|
652
|
+
if self.INPpar.FlagCollapBox:
|
|
653
|
+
self.ui.CollapBox_ImSet.openBox()
|
|
654
|
+
else:
|
|
655
|
+
self.ui.CollapBox_ImSet.closeBox()
|
|
656
|
+
"""
|
|
657
|
+
|
|
658
|
+
def button_automatic_frame_set(self):
|
|
659
|
+
self.ui.button_automatic_frame.setChecked(INPpar.FlagAutoFrame)
|
|
660
|
+
|
|
661
|
+
def combo_frame_a_set(self):
|
|
662
|
+
i=self.INPpar.frame_1[self.INPpar.inp_cam-1]
|
|
663
|
+
self.ui.combo_frame_a.setCurrentIndex(i)
|
|
664
|
+
|
|
665
|
+
def combo_frame_b_set(self):
|
|
666
|
+
i=self.INPpar.frame_2[self.INPpar.inp_cam-1]
|
|
667
|
+
self.ui.combo_frame_b.setCurrentIndex(i)
|
|
668
|
+
|
|
669
|
+
def button_example_list_set(self):
|
|
670
|
+
self.ui.button_example_list.setChecked(INPpar.FlagExample)
|
|
671
|
+
|
|
672
|
+
#******************** Layout & Adjustments
|
|
673
|
+
def setImageNumberSpinLimits(self):
|
|
674
|
+
if self.INPpar.isDifferentFrom(self.INPpar_old,fields=['imSet','frame_1','frame_2','inp_ncam','FlagTR_Import']):
|
|
675
|
+
ind_in, ind_fin, npairs, npairs_max= self.getIndNpairs()
|
|
676
|
+
self.INPpar.ind_in=min([max([ind_in,self.INPpar.ind_in]),ind_fin])
|
|
677
|
+
self.INPpar.npairs=npairs if self.INPpar.isDifferentFrom(self.INPpar_old,fields=['FlagTR_Import']) else min([self.INPpar.npairs,npairs])
|
|
678
|
+
self.INPpar.step=max([min([self.INPpar.step,npairs]),1])
|
|
679
|
+
|
|
680
|
+
self.ui.spin_ind_in.setMinimum(ind_in)
|
|
681
|
+
self.ui.spin_ind_in.setMaximum(ind_fin)
|
|
682
|
+
s_ind_in=formatNumber(self.ui.spin_ind_in,ind_in)
|
|
683
|
+
s_ind_fin=formatNumber(self.ui.spin_ind_in,ind_fin)
|
|
684
|
+
self.ui.spin_ind_in.setToolTip(f'Number of the first image in the sequence to process. Min.: {s_ind_in}, max: {s_ind_fin}')
|
|
685
|
+
self.ui.spin_ind_in.setStatusTip(self.ui.spin_ind_in.toolTip())
|
|
686
|
+
|
|
687
|
+
self.ui.spin_npairs.setMinimum(0)
|
|
688
|
+
self.ui.spin_npairs.setMaximum(npairs_max)
|
|
689
|
+
self.ui.spin_npairs.setToolTip(f'Number of image pairs to process. Max: {npairs_max}')
|
|
690
|
+
self.ui.spin_npairs.setStatusTip(self.ui.spin_npairs.toolTip())
|
|
691
|
+
|
|
692
|
+
self.ui.spin_step.setMinimum(1)
|
|
693
|
+
self.ui.spin_step.setMaximum(npairs_max)
|
|
694
|
+
#ind_in=self.INPpar.imSet.ind_in[self.INPpar.frame_a]
|
|
695
|
+
pass
|
|
696
|
+
|
|
697
|
+
def getIndNpairs(self,ind=None):
|
|
698
|
+
INP = self.INPpar if ind is None else self.TABpar_at(ind)
|
|
699
|
+
if INP.imSet.count:
|
|
700
|
+
l=[INP.imSet.ind_in[f] for f in INP.frame_1 if f>-1]
|
|
701
|
+
ind_in_1=min(l) if l else None
|
|
702
|
+
l=[INP.imSet.ind_in[f-1] for f in INP.frame_2 if f>0]
|
|
703
|
+
ind_in_2=min(l) if l else ind_in_1 if ind_in_1 is not None else None
|
|
704
|
+
ind_in=min([ind_in_1,ind_in_2]) if ind_in_2 is not None else 0
|
|
705
|
+
|
|
706
|
+
l=[INP.imSet.ind_fin[f] for f in INP.frame_1 if f>-1]
|
|
707
|
+
ind_fin_1=max(l) if l else None
|
|
708
|
+
l=[INP.imSet.ind_fin[f-1] for f in INP.frame_2 if f>0]
|
|
709
|
+
ind_fin_2=max(l) if l else ind_fin_1 if ind_fin_1 is not None else None
|
|
710
|
+
ind_fin=min([ind_fin_1,ind_fin_2]) if ind_fin_2 is not None else -1
|
|
711
|
+
else:
|
|
712
|
+
ind_in=ind_in_2=0
|
|
713
|
+
ind_fin=-1
|
|
714
|
+
npairs=nimg=ind_fin-ind_in+1
|
|
715
|
+
if not all(INP.frame_2):
|
|
716
|
+
npairs=int(npairs/2)
|
|
717
|
+
if INP.FlagTR_Import:
|
|
718
|
+
npairs=2*npairs-1+nimg%2 #(1+int(any(INP.frame_2)))*npairs-1
|
|
719
|
+
if npairs==0: ind_in=ind_fin=0
|
|
720
|
+
npairs_max=npairs
|
|
721
|
+
return ind_in, ind_fin, npairs, npairs_max
|
|
722
|
+
|
|
723
|
+
def adjustExampleImageList(self):
|
|
724
|
+
exImListPar=['path','frame_1','frame_2','inp_ncam','ind_in','npairs','step','FlagTR_Import']
|
|
725
|
+
if self.INPpar.isDifferentFrom(self.INPpar_old,fields=exImListPar):
|
|
726
|
+
#self.INPpar_old.printDifferences(self.INPpar,fields=exImListPar)
|
|
727
|
+
self.INPpar.exImList,self.INPpar.exImEx=self.INPpar.imSet.genListsFromFrame(self.INPpar.frame_1,self.INPpar.frame_2,self.INPpar.ind_in,min([self.INPpar.npairs,self.INPpar.nExImTree]),self.INPpar.step,self.INPpar.FlagTR_Import)
|
|
728
|
+
|
|
729
|
+
def layoutExampleImageList(self):
|
|
730
|
+
if self.exImTree.imEx!=self.INPpar.exImEx or self.exImTree.imList!=self.INPpar.exImList:
|
|
731
|
+
self.exImTree.imList=self.INPpar.exImList
|
|
732
|
+
self.exImTree.imEx=self.INPpar.exImEx
|
|
733
|
+
self.exImTree.ncam=self.INPpar.ncam
|
|
734
|
+
self.exImTree.setImListEx()
|
|
735
|
+
self.exImTree.path=self.INPpar.path
|
|
736
|
+
self.exImTree.ncam=self.INPpar.inp_ncam
|
|
737
|
+
self.exImTree.setLists(FlagAsync=False)
|
|
738
|
+
self.exImTree.resizeColumnToContents(2)
|
|
739
|
+
if self.INPpar.inp_ncam==1: self.INPpar.exImTreeExp=[False]*3
|
|
740
|
+
height=self.exImTree.header().height()+5
|
|
741
|
+
#itemHeight=20
|
|
742
|
+
#height=itemHeight+5
|
|
743
|
+
for i in range(3):
|
|
744
|
+
item = self.exImTree.topLevelItem(i)
|
|
745
|
+
if not item: continue
|
|
746
|
+
item.setExpanded(self.INPpar.exImTreeExp[i])
|
|
747
|
+
height+=self.exImTree.visualItemRect(item).height()
|
|
748
|
+
for c in range(item.childCount()):
|
|
749
|
+
height+=self.exImTree.visualItemRect(item.child(c)).height()
|
|
750
|
+
#if self.INPpar.exImTreeExp[i]:
|
|
751
|
+
# height+=item.childCount()*itemHeight
|
|
752
|
+
#else: height+=itemHeight
|
|
753
|
+
self.exImTree.setMinimumHeight(height)
|
|
754
|
+
self.exImTree.setMaximumHeight(height)
|
|
755
|
+
self.exImTree.verticalScrollBar().setMinimumHeight(height)
|
|
756
|
+
self.exImTree.verticalScrollBar().setMaximumHeight(height)
|
|
757
|
+
if self.hbarExImTree.maximum()==self.hbarExImTree.minimum():
|
|
758
|
+
self.hbarExImTree.setVisible(False)
|
|
759
|
+
containerHeight=height
|
|
760
|
+
else:
|
|
761
|
+
self.hbarExImTree.setVisible(True)
|
|
762
|
+
containerHeight=height+self.hbarExImTree.height()
|
|
763
|
+
self.containerExImTree.setMinimumHeight(containerHeight)
|
|
764
|
+
self.containerExImTree.setMaximumHeight(containerHeight)
|
|
765
|
+
self.ui.CollapBox_ImSet.heightArea=height+110 if INPpar.FlagExample else 110
|
|
766
|
+
self.ui.CollapBox_ImSet.heightOpened=self.ui.CollapBox_ImSet.heightArea+20
|
|
767
|
+
self.ui.CollapBox_ImSet.on_click()
|
|
768
|
+
|
|
769
|
+
def itemExpandedCollapsed(self):
|
|
770
|
+
for i in range(self.exImTree.topLevelItemCount()):
|
|
771
|
+
item = self.exImTree.topLevelItem(i)
|
|
772
|
+
self.INPpar.exImTreeExp[i]=item.isExpanded()
|
|
773
|
+
self.layoutExampleImageList()
|
|
774
|
+
return True
|
|
775
|
+
|
|
776
|
+
#*************************************************** Image import tool
|
|
777
|
+
#******************** Actions
|
|
778
|
+
def image_list_action(self):
|
|
779
|
+
self.INPpar.imList=self.ui.imTreeWidget.imTree.imList
|
|
780
|
+
self.INPpar.imEx=self.ui.imTreeWidget.imTree.imEx
|
|
781
|
+
FlagDifferent=self.INPpar.isDifferentFrom(self.INPpar_old,fields=['imList'])
|
|
782
|
+
self.INPpar.FlagImport=False
|
|
783
|
+
return not FlagDifferent
|
|
784
|
+
|
|
785
|
+
def selection_action(self):
|
|
786
|
+
if QApplication.keyboardModifiers(): return
|
|
787
|
+
w=self.ui.imTreeWidget
|
|
788
|
+
if w.imTree.FlagSetting: return
|
|
789
|
+
self.INPpar.selection=[w.spin_img.value(),w.spin_cam.value(),w.spin_frame.value()]
|
|
790
|
+
self.InputAdjustSelection()
|
|
791
|
+
if not TABpar.FlagSettingPar and not self.FlagSettingPar:
|
|
792
|
+
FlagAdjustPar=True
|
|
793
|
+
self.setTABpar_bridge(FlagAdjustPar,FlagCallback=True)
|
|
794
|
+
return True
|
|
795
|
+
|
|
796
|
+
def InputAdjustSelection(self,INP:INPpar=None):
|
|
797
|
+
if INP is None: INP=self.INPpar
|
|
798
|
+
if len(self.TABpar_prev_at(INP.ind)):
|
|
799
|
+
self.TABpar_at(INP.ind).selection=copy.deepcopy(INP.selection)
|
|
800
|
+
|
|
801
|
+
#******************** Settings
|
|
802
|
+
def image_list_set(self):
|
|
803
|
+
FlagNewLists=self.INPpar.isDifferentFrom(self.ui.imTreeWidget.imTree,fields=['imList','imEx'])
|
|
804
|
+
if FlagNewLists and (not self.ImTreeInd or self.ImTreeInd!=self.INPpar.ind) and (self.ui.imTreeWidget.imTree.itemWorker is None or self.INPpar.ind!=self.INPpar_old.ind):
|
|
805
|
+
self.ImTreeInd=copy.deepcopy(self.INPpar.ind)
|
|
806
|
+
self.ui.imTreeWidget.imTree.signals.updateLists.disconnect()
|
|
807
|
+
self.ui.imTreeWidget.imTree.signals.updateLists.connect(self.restoreSignal)
|
|
808
|
+
self.ui.imTreeWidget.setLists(self.INPpar.path,self.INPpar.imList,self.INPpar.imEx,selection=self.INPpar.selection,FlagOnlyPrepare=not FlagNewLists)
|
|
809
|
+
if not FlagNewLists: self.restoreSignal()
|
|
810
|
+
self.ui.imTreeWidget.imTree.spinSelection(self.INPpar.selection)
|
|
811
|
+
|
|
812
|
+
def emptyImTreeInd(self):
|
|
813
|
+
self.ImTreeInd=[]
|
|
814
|
+
|
|
815
|
+
@Slot()
|
|
816
|
+
def restoreSignal(self):
|
|
817
|
+
self.ui.imTreeWidget.imTree.signals.updateLists.disconnect()
|
|
818
|
+
self.ui.imTreeWidget.imTree.signals.updateLists.connect(self.image_list_callback)
|
|
819
|
+
|
|
820
|
+
if __name__ == "__main__":
|
|
821
|
+
import sys
|
|
822
|
+
app=QApplication.instance()
|
|
823
|
+
if not app:app = QApplication(sys.argv)
|
|
824
|
+
app.setStyle('Fusion')
|
|
825
|
+
object = Input_Tab(None)
|
|
826
|
+
object.show()
|
|
827
|
+
app.exec()
|
|
828
|
+
app.quit()
|
|
829
|
+
app=None
|