cellects 0.3.2__tar.gz → 0.3.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. {cellects-0.3.2 → cellects-0.3.4}/PKG-INFO +9 -9
  2. {cellects-0.3.2 → cellects-0.3.4}/README.md +8 -8
  3. {cellects-0.3.2 → cellects-0.3.4}/pyproject.toml +1 -1
  4. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/core/cellects_paths.py +1 -1
  5. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/core/script_based_run.py +5 -1
  6. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/gui/advanced_parameters.py +21 -32
  7. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/gui/cellects.py +10 -4
  8. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/gui/custom_widgets.py +4 -103
  9. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/gui/first_window.py +37 -43
  10. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/gui/if_several_folders_window.py +11 -18
  11. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/gui/image_analysis_window.py +103 -119
  12. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/gui/required_output.py +7 -16
  13. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/gui/video_analysis_window.py +50 -65
  14. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/image_analysis/shape_descriptors.py +1 -1
  15. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/utils/load_display_save.py +2 -2
  16. {cellects-0.3.2 → cellects-0.3.4}/src/cellects.egg-info/PKG-INFO +9 -9
  17. {cellects-0.3.2 → cellects-0.3.4}/tests/test_based_run.py +1 -1
  18. {cellects-0.3.2 → cellects-0.3.4}/tests/test_program_organizer.py +5 -5
  19. {cellects-0.3.2 → cellects-0.3.4}/LICENSE +0 -0
  20. {cellects-0.3.2 → cellects-0.3.4}/setup.cfg +0 -0
  21. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/__init__.py +0 -0
  22. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/__main__.py +0 -0
  23. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/config/__init__.py +0 -0
  24. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/config/all_vars_dict.py +0 -0
  25. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/core/__init__.py +0 -0
  26. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/core/cellects_threads.py +0 -0
  27. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/core/motion_analysis.py +0 -0
  28. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/core/one_image_analysis.py +0 -0
  29. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/core/program_organizer.py +0 -0
  30. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/gui/__init__.py +0 -0
  31. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/gui/ui_strings.py +0 -0
  32. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/icons/__init__.py +0 -0
  33. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/icons/cellects_icon.icns +0 -0
  34. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/icons/cellects_icon.ico +0 -0
  35. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/image_analysis/__init__.py +0 -0
  36. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/image_analysis/cell_leaving_detection.py +0 -0
  37. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/image_analysis/image_segmentation.py +0 -0
  38. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/image_analysis/morphological_operations.py +0 -0
  39. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/image_analysis/network_functions.py +0 -0
  40. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/image_analysis/one_image_analysis_threads.py +0 -0
  41. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/image_analysis/oscillations_functions.py +0 -0
  42. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/image_analysis/progressively_add_distant_shapes.py +0 -0
  43. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/utils/__init__.py +0 -0
  44. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/utils/decorators.py +0 -0
  45. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/utils/formulas.py +0 -0
  46. {cellects-0.3.2 → cellects-0.3.4}/src/cellects/utils/utilitarian.py +0 -0
  47. {cellects-0.3.2 → cellects-0.3.4}/src/cellects.egg-info/SOURCES.txt +0 -0
  48. {cellects-0.3.2 → cellects-0.3.4}/src/cellects.egg-info/dependency_links.txt +0 -0
  49. {cellects-0.3.2 → cellects-0.3.4}/src/cellects.egg-info/entry_points.txt +0 -0
  50. {cellects-0.3.2 → cellects-0.3.4}/src/cellects.egg-info/requires.txt +0 -0
  51. {cellects-0.3.2 → cellects-0.3.4}/src/cellects.egg-info/top_level.txt +0 -0
  52. {cellects-0.3.2 → cellects-0.3.4}/tests/test_cell_leaving_detection.py +0 -0
  53. {cellects-0.3.2 → cellects-0.3.4}/tests/test_formulas.py +0 -0
  54. {cellects-0.3.2 → cellects-0.3.4}/tests/test_image_segmentation.py +0 -0
  55. {cellects-0.3.2 → cellects-0.3.4}/tests/test_load_display_save.py +0 -0
  56. {cellects-0.3.2 → cellects-0.3.4}/tests/test_morphological_operations.py +0 -0
  57. {cellects-0.3.2 → cellects-0.3.4}/tests/test_motion_analysis.py +0 -0
  58. {cellects-0.3.2 → cellects-0.3.4}/tests/test_network_functions.py +0 -0
  59. {cellects-0.3.2 → cellects-0.3.4}/tests/test_one_image_analysis.py +0 -0
  60. {cellects-0.3.2 → cellects-0.3.4}/tests/test_progressively_add_distant_shapes.py +0 -0
  61. {cellects-0.3.2 → cellects-0.3.4}/tests/test_shape_descriptors.py +0 -0
  62. {cellects-0.3.2 → cellects-0.3.4}/tests/test_utilitarian.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cellects
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: Cell Expansion Computer Tracking Software.
5
5
  Author: Aurèle Boussard
6
6
  License: GNU GENERAL PUBLIC LICENSE
@@ -748,7 +748,7 @@ easy installation and user-friendly interface.
748
748
 
749
749
  ---
750
750
 
751
- ## 🚀 Installation (Short version)
751
+ ## Installation (Short version)
752
752
  Install using our Windows installer: [Cellects_installer.exe](https://github.com/Aurele-B/Cellects/releases/)
753
753
 
754
754
  Or, install via pip:
@@ -759,15 +759,15 @@ Any difficulties? follow our [complete installation tutorial](https://aurele-b.g
759
759
 
760
760
  ---
761
761
 
762
- ## 🎯 Quick Start
762
+ ## Quick Start
763
763
  Run in terminal:
764
764
  ```bash
765
- Cellects
765
+ cellects
766
766
  ```
767
767
 
768
768
  ---
769
769
 
770
- ## 📚 Documentation
770
+ ## Documentation
771
771
 
772
772
  Cellects' workflow is described in a [complete documentation](https://aurele-b.github.io/Cellects/). It includes:
773
773
  - [**What is Cellects**](https://aurele-b.github.io/Cellects/what-is-cellects/): Purpose of the software, usable data and introduction of its user manual
@@ -779,7 +779,7 @@ Cellects' workflow is described in a [complete documentation](https://aurele-b.g
779
779
 
780
780
  ---
781
781
 
782
- ## 🧪 Use Cases
782
+ ## Use Cases
783
783
 
784
784
  See [use cases](https://aurele-b.github.io/Cellects/use-cases/) for real-world examples:
785
785
  - Automated Physarum polycephalum tracking using GUI
@@ -788,7 +788,7 @@ See [use cases](https://aurele-b.github.io/Cellects/use-cases/) for real-world e
788
788
 
789
789
  ---
790
790
 
791
- ## 🛠 Contributing
791
+ ## Contributing
792
792
 
793
793
  We welcome contributions!
794
794
  1. Fork the repository and create a new branch.
@@ -798,7 +798,7 @@ For developer workflows, see [**Contributing**](https://aurele-b.github.io/Celle
798
798
 
799
799
  ---
800
800
 
801
- ## 📌 License & Citation
801
+ ## License & Citation
802
802
 
803
803
  GNU GPL3 License (see [LICENSE](https://github.com/Aurele-B/cellects/blob/main/LICENSE)).
804
804
 
@@ -816,7 +816,7 @@ To cite Cellects, use:
816
816
 
817
817
  ---
818
818
 
819
- ## 🧪 Testing
819
+ ## Testing
820
820
 
821
821
  Run unit tests with:
822
822
  ```bash
@@ -28,7 +28,7 @@ easy installation and user-friendly interface.
28
28
 
29
29
  ---
30
30
 
31
- ## 🚀 Installation (Short version)
31
+ ## Installation (Short version)
32
32
  Install using our Windows installer: [Cellects_installer.exe](https://github.com/Aurele-B/Cellects/releases/)
33
33
 
34
34
  Or, install via pip:
@@ -39,15 +39,15 @@ Any difficulties? follow our [complete installation tutorial](https://aurele-b.g
39
39
 
40
40
  ---
41
41
 
42
- ## 🎯 Quick Start
42
+ ## Quick Start
43
43
  Run in terminal:
44
44
  ```bash
45
- Cellects
45
+ cellects
46
46
  ```
47
47
 
48
48
  ---
49
49
 
50
- ## 📚 Documentation
50
+ ## Documentation
51
51
 
52
52
  Cellects' workflow is described in a [complete documentation](https://aurele-b.github.io/Cellects/). It includes:
53
53
  - [**What is Cellects**](https://aurele-b.github.io/Cellects/what-is-cellects/): Purpose of the software, usable data and introduction of its user manual
@@ -59,7 +59,7 @@ Cellects' workflow is described in a [complete documentation](https://aurele-b.g
59
59
 
60
60
  ---
61
61
 
62
- ## 🧪 Use Cases
62
+ ## Use Cases
63
63
 
64
64
  See [use cases](https://aurele-b.github.io/Cellects/use-cases/) for real-world examples:
65
65
  - Automated Physarum polycephalum tracking using GUI
@@ -68,7 +68,7 @@ See [use cases](https://aurele-b.github.io/Cellects/use-cases/) for real-world e
68
68
 
69
69
  ---
70
70
 
71
- ## 🛠 Contributing
71
+ ## Contributing
72
72
 
73
73
  We welcome contributions!
74
74
  1. Fork the repository and create a new branch.
@@ -78,7 +78,7 @@ For developer workflows, see [**Contributing**](https://aurele-b.github.io/Celle
78
78
 
79
79
  ---
80
80
 
81
- ## 📌 License & Citation
81
+ ## License & Citation
82
82
 
83
83
  GNU GPL3 License (see [LICENSE](https://github.com/Aurele-B/cellects/blob/main/LICENSE)).
84
84
 
@@ -96,7 +96,7 @@ To cite Cellects, use:
96
96
 
97
97
  ---
98
98
 
99
- ## 🧪 Testing
99
+ ## Testing
100
100
 
101
101
  Run unit tests with:
102
102
  ```bash
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cellects"
7
- version = "0.3.2"
7
+ version = "0.3.4"
8
8
  description = "Cell Expansion Computer Tracking Software."
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -24,7 +24,7 @@ REPO_ROOT = CELLECTS_DIR.parent.parent
24
24
 
25
25
  # Repo-level dirs
26
26
  DATA_DIR = REPO_ROOT / "data"
27
- EXPERIMENTS_DIR = DATA_DIR / "experiment"
27
+ EXPERIMENTS_DIR = DATA_DIR / "single_experiment"
28
28
  TEST_DIR = REPO_ROOT / "tests"
29
29
 
30
30
  # Example packaged file
@@ -35,7 +35,7 @@ def load_data(rgb_video: NDArray=None, pathway: str='', sample_number:int=None,
35
35
  po = ProgramOrganizer()
36
36
  if rgb_video is None:
37
37
  if len(pathway) == 0:
38
- pathway = Path(os.getcwd() + "/data/experiment")
38
+ pathway = Path(os.getcwd() + "/data/single_experiment")
39
39
  po.all['global_pathway'] = pathway
40
40
  po.all['first_folder_sample_number'] = sample_number
41
41
  po.all['radical'] = radical
@@ -87,6 +87,10 @@ def run_one_video_analysis(po, with_video_in_ram: bool=False):
87
87
  l = [i, i + 1, po.vars, segment, False, show_seg, videos_already_in_ram]
88
88
  MA = MotionAnalysis(l)
89
89
  MA.get_descriptors_from_binary()
90
+ if os.path.isfile('colony_centroids1_20col_t20_y1000_x1000.csv'):
91
+ os.remove('colony_centroids1_20col_t20_y1000_x1000.csv')
92
+ if os.path.isfile('data/single_experiment/colony_centroids1_20col_t20_y1000_x1000.csv'):
93
+ os.remove('data/single_experiment/colony_centroids1_20col_t20_y1000_x1000.csv')
90
94
  # MA.detect_growth_transitions()
91
95
  # MA.networks_analysis(show_seg)
92
96
  # MA.study_cytoscillations(show_seg)
@@ -558,24 +558,25 @@ class AdvancedParameters(WindowType):
558
558
  self.right_col_layout.addWidget(self.edit_widget)
559
559
 
560
560
  # VIII/ Finalize layout and add the night mode option and the ok button
561
- self.left_col_layout.addItem(self.vertical_space)
562
- self.right_col_layout.addItem(self.vertical_space)
561
+ self.left_col_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.MinimumExpanding))
562
+ self.right_col_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.MinimumExpanding))
563
563
  self.left_col_widget.setLayout(self.left_col_layout)
564
564
  self.right_col_widget.setLayout(self.right_col_layout)
565
+ self.central_widget = QtWidgets.QWidget()
565
566
  self.central_layout = QtWidgets.QHBoxLayout()
566
- self.central_layout.addItem(self.horizontal_space)
567
+ self.central_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
567
568
  self.left_scroll_table.setWidget(self.left_col_widget)
568
569
  self.left_scroll_table.setWidgetResizable(True)
570
+ self.left_scroll_table.setParent(self.central_widget)
569
571
  self.central_layout.addWidget(self.left_scroll_table)
570
- self.central_layout.addItem(self.horizontal_space)
572
+ self.central_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
571
573
  self.right_scroll_table.setWidget(self.right_col_widget)
572
574
  self.right_scroll_table.setWidgetResizable(True)
575
+ self.right_scroll_table.setParent(self.central_widget)
573
576
  self.central_layout.addWidget(self.right_scroll_table)
574
- self.central_layout.addItem(self.horizontal_space)
575
- self.central_widget = QtWidgets.QWidget()
577
+ self.central_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
576
578
  self.central_widget.setLayout(self.central_layout)
577
579
  self.layout.addWidget(self.central_widget)
578
- # self.layout.addItem(self.vertical_space)
579
580
 
580
581
  # Last row
581
582
  self.last_row_layout = QtWidgets.QHBoxLayout()
@@ -595,7 +596,7 @@ class AdvancedParameters(WindowType):
595
596
  self.last_row_layout.addWidget(self.night_mode_cb)
596
597
  self.last_row_layout.addWidget(self.night_mode_label)
597
598
  self.last_row_layout.addWidget(self.reset_all_settings)
598
- self.last_row_layout.addItem(self.horizontal_space)
599
+ self.last_row_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
599
600
  self.last_row_layout.addWidget(self.message)
600
601
  self.last_row_layout.addWidget(self.cancel)
601
602
  self.last_row_layout.addWidget(self.ok)
@@ -746,15 +747,13 @@ class AdvancedParameters(WindowType):
746
747
  """
747
748
  self.edit_widget = QtWidgets.QWidget()
748
749
  self.edit_layout = QtWidgets.QVBoxLayout()
749
- self.csc_table_widget = QtWidgets.QWidget()
750
- self.csc_table_layout = QtWidgets.QVBoxLayout()
751
750
 
752
751
  # 2) Titles
753
752
  self.video_csc_label = FixedText(AP["Csc_for_video_analysis"]["label"] + ':',
754
753
  tip=AP["Csc_for_video_analysis"]["tips"],
755
754
  night_mode=self.parent().po.all['night_mode'])
756
755
  self.video_csc_label.setFixedHeight(30)
757
- self.csc_table_layout.addWidget(self.video_csc_label)
756
+ self.edit_layout.addWidget(self.video_csc_label)
758
757
  self.both_csc_widget = QtWidgets.QWidget()
759
758
  self.both_csc_layout = QtWidgets.QHBoxLayout()
760
759
 
@@ -786,7 +785,7 @@ class AdvancedParameters(WindowType):
786
785
  self.row2[i].setVisible(False)
787
786
  self.row3[i].setVisible(False)
788
787
  self.first_csc_layout.setHorizontalSpacing(0)
789
- self.first_csc_layout.addItem(self.horizontal_space, 0, 5, 3, 1)
788
+ self.first_csc_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum), 0, 5, 3, 1)
790
789
  self.first_csc_widget.setLayout(self.first_csc_layout)
791
790
  self.both_csc_layout.addWidget(self.first_csc_widget)
792
791
 
@@ -801,12 +800,12 @@ class AdvancedParameters(WindowType):
801
800
  self.row22[i].setVisible(False)
802
801
  self.row23[i].setVisible(False)
803
802
  self.second_csc_layout.setHorizontalSpacing(0)
804
- self.second_csc_layout.addItem(self.horizontal_space, 0, 5, 3, 1)
803
+ self.second_csc_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum), 0, 5, 3, 1)
805
804
  self.second_csc_widget.setLayout(self.second_csc_layout)
806
- self.both_csc_layout.addItem(self.horizontal_space)
805
+ self.both_csc_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
807
806
  self.both_csc_layout.addWidget(self.second_csc_widget)
808
807
  self.both_csc_widget.setLayout(self.both_csc_layout)
809
- self.csc_table_layout.addWidget(self.both_csc_widget)
808
+ self.edit_layout.addWidget(self.both_csc_widget)
810
809
 
811
810
  # 4) logical_operator
812
811
  self.logical_op_widget = QtWidgets.QWidget()
@@ -814,12 +813,12 @@ class AdvancedParameters(WindowType):
814
813
  self.logical_op_layout = QtWidgets.QHBoxLayout()
815
814
  self.logical_op_layout.addWidget(self.logical_operator_label)
816
815
  self.logical_op_layout.addWidget(self.logical_operator_between_combination_result)
817
- self.logical_op_layout.addItem(self.horizontal_space)
816
+ self.logical_op_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
818
817
  self.logical_operator_between_combination_result.setVisible(False)
819
818
  self.logical_operator_label.setVisible(False)
820
819
  self.logical_op_widget.setLayout(self.logical_op_layout)
821
820
  self.logical_op_widget.setFixedHeight(50)
822
- self.csc_table_layout.addWidget(self.logical_op_widget)
821
+ self.edit_layout.addWidget(self.logical_op_widget)
823
822
 
824
823
  # 6) Open the more_than_2_colors row layout
825
824
  self.more_than_2_colors_widget = QtWidgets.QWidget()
@@ -843,15 +842,11 @@ class AdvancedParameters(WindowType):
843
842
  self.more_than_2_colors_layout.addWidget(self.more_than_two_colors)
844
843
  self.more_than_2_colors_layout.addWidget(self.more_than_two_colors_label)
845
844
  self.more_than_2_colors_layout.addWidget(self.distinct_colors_number)
846
- self.more_than_2_colors_layout.addItem(self.horizontal_space)
845
+ self.more_than_2_colors_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
847
846
  self.more_than_2_colors_widget.setLayout(self.more_than_2_colors_layout)
848
847
  self.more_than_2_colors_widget.setFixedHeight(50)
849
- self.csc_table_layout.addWidget(self.more_than_2_colors_widget)
850
- self.csc_table_layout.addItem(self.vertical_space)
851
- self.csc_table_widget.setLayout(self.csc_table_layout)
852
-
853
- self.edit_layout.addWidget(self.csc_table_widget)
854
-
848
+ self.edit_layout.addWidget(self.more_than_2_colors_widget)
849
+ self.edit_layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.MinimumExpanding))
855
850
  self.edit_widget.setLayout(self.edit_layout)
856
851
 
857
852
  def one_csc_editing(self):
@@ -1303,16 +1298,10 @@ class AdvancedParameters(WindowType):
1303
1298
  if not are_dicts_equal:
1304
1299
  self.parent().po.find_if_lighter_background()
1305
1300
 
1306
- if not self.parent().thread['SaveAllVars'].isRunning():
1307
- self.parent().thread['SaveAllVars'].start()
1301
+ if not self.parent().thread_dict['SaveAllVars'].isRunning():
1302
+ self.parent().thread_dict['SaveAllVars'].start()
1308
1303
 
1309
1304
  if self.parent().last_is_first:
1310
1305
  self.parent().change_widget(0) # FirstWidget
1311
1306
  else:
1312
1307
  self.parent().change_widget(3) # ImageAnalysisWindow ThirdWidget
1313
-
1314
- def closeEvent(self, event):
1315
- """
1316
- Handle the close event for a QWidget.
1317
- """
1318
- event.accept
@@ -110,8 +110,8 @@ class CellectsMainWidget(QtWidgets.QStackedWidget):
110
110
 
111
111
  self.instantiate_widgets()
112
112
 
113
- self.thread = {}
114
- self.thread['SaveAllVars'] = SaveAllVarsThread(self)
113
+ self.thread_dict = {}
114
+ self.thread_dict['SaveAllVars'] = SaveAllVarsThread(self)
115
115
  self.change_widget(0)
116
116
  self.center()
117
117
 
@@ -192,9 +192,15 @@ class CellectsMainWidget(QtWidgets.QStackedWidget):
192
192
  QtWidgets.QMessageBox.No)
193
193
 
194
194
  if reply == QtWidgets.QMessageBox.Yes:
195
- signal.signal(signal.SIGSEGV, signal.SIG_IGN)
195
+ for _, thread in self.imageanalysiswindow.thread_dict.items():
196
+ thread.wait()
197
+ for _, thread in self.ifseveralfolderswindow.thread_dict.items():
198
+ thread.wait()
199
+ for _, thread in self.videoanalysiswindow.thread_dict.items():
200
+ thread.wait()
201
+ for _, thread in self.firstwindow.thread_dict.items():
202
+ thread.wait()
196
203
  logging.info("Closing main window.")
197
204
  event.accept()
198
- self.close()
199
205
  else:
200
206
  event.ignore()
@@ -16,9 +16,6 @@ print(font_names)
16
16
  "Baskerville" in font_names
17
17
  """
18
18
 
19
- # colorblind-friendly : rgb(42, 251, 97) , rgb(126, 85, 197)
20
- # titlesize = 40
21
-
22
19
  if os.name == 'nt':
23
20
  buttonfont = QFont("Century Gothic", 17, QFont.Bold)
24
21
  titlefont = f"Baskerville Old Face" #"40pt Baskerville Old Face"
@@ -60,6 +57,7 @@ class WindowType(QtWidgets.QWidget):
60
57
  def __init__(self, parent, night_mode=False):
61
58
  super().__init__()
62
59
 
60
+ self.thread_dict = {}
63
61
  self.setVisible(False)
64
62
  self.setParent(parent)
65
63
  self.frame = QtWidgets.QFrame(self)
@@ -67,10 +65,6 @@ class WindowType(QtWidgets.QWidget):
67
65
  self.display_image = None
68
66
  self.setFont(QFont(textfont, textsize, QFont.Medium))
69
67
  self.night_mode_switch(night_mode)
70
- self.horizontal_space = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding,
71
- QtWidgets.QSizePolicy.Maximum)
72
- self.vertical_space = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Maximum,
73
- QtWidgets.QSizePolicy.MinimumExpanding)
74
68
 
75
69
  def resizeEvent(self, event):
76
70
  '''
@@ -125,7 +119,7 @@ class MainTabsType(WindowType):
125
119
  self.main_tabs_layout.addWidget(self.video_tab)
126
120
  self.main_tabs_widget.setLayout(self.main_tabs_layout)
127
121
  self.Vlayout.addWidget(self.main_tabs_widget)
128
- self.Vlayout.addItem(self.vertical_space)
122
+ self.Vlayout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.MinimumExpanding))
129
123
 
130
124
 
131
125
  class FullScreenImage(QtWidgets.QLabel):
@@ -134,10 +128,8 @@ class FullScreenImage(QtWidgets.QLabel):
134
128
  self.true_shape = image.shape
135
129
  self.max_height = screen_height
136
130
  self.max_width = screen_width
137
- # self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
138
131
  self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
139
132
  QtWidgets.QSizePolicy.MinimumExpanding)
140
- # self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
141
133
  self.setSizePolicy(self.im_size_policy)
142
134
 
143
135
  self.height_width_ratio = image.shape[0] / image.shape[1]
@@ -149,10 +141,6 @@ class FullScreenImage(QtWidgets.QLabel):
149
141
  self.scaled_shape = [round(self.max_width * self.height_width_ratio), self.max_width]
150
142
  else:
151
143
  self.scaled_shape = [self.max_height, np.round(self.max_height / self.height_width_ratio)]
152
- # self.setFixedHeight(self.scaled_shape[0])
153
- # self.setFixedWidth(self.scaled_shape[1])
154
- # self.setMaximumHeight(self.scaled_shape[0])
155
- # self.setMaximumWidth(self.scaled_shape[1])
156
144
  self.setMinimumSize(self.scaled_shape[1], self.scaled_shape[0])
157
145
  self.setPixmap(QPixmap(image))
158
146
  self.adjustSize()
@@ -164,10 +152,8 @@ class InsertImage(QtWidgets.QLabel):
164
152
  self.true_shape = image.shape
165
153
  self.max_height = max_height
166
154
  self.max_width = max_width
167
- # self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
168
155
  self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding,
169
156
  QtWidgets.QSizePolicy.MinimumExpanding)
170
- # self.im_size_policy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
171
157
  self.setSizePolicy(self.im_size_policy)
172
158
 
173
159
  self.height_width_ratio = image.shape[0] / image.shape[1]
@@ -179,12 +165,8 @@ class InsertImage(QtWidgets.QLabel):
179
165
  self.scaled_shape = [round(self.max_width * self.height_width_ratio), self.max_width]
180
166
  else:
181
167
  self.scaled_shape = [self.max_height, np.round(self.max_height / self.height_width_ratio)]
182
- # self.setFixedHeight(self.scaled_shape[0])
183
- # self.setFixedWidth(self.scaled_shape[1])
184
168
  self.setMaximumHeight(self.scaled_shape[0])
185
169
  self.setMaximumWidth(self.scaled_shape[1])
186
- # self.resize(self.scaled_shape[1], self.scaled_shape[0])
187
- # self.setMinimumSize(self.scaled_shape[0], self.scaled_shape[1])
188
170
  self.setPixmap(QPixmap(image))
189
171
  self.adjustSize()
190
172
 
@@ -200,18 +182,8 @@ class InsertImage(QtWidgets.QLabel):
200
182
  self.scaled_shape = [int(np.round(self.max_width * self.height_width_ratio)), self.max_width]
201
183
  else:
202
184
  self.scaled_shape = [self.max_height, int(np.round(self.max_height / self.height_width_ratio))]
203
- # self.setFixedHeight(self.scaled_shape[0])
204
- # self.setFixedWidth(self.scaled_shape[1])
205
185
  self.setMaximumHeight(self.scaled_shape[0])
206
186
  self.setMaximumWidth(self.scaled_shape[1])
207
- # self.resize(self.scaled_shape[1], self.scaled_shape[0])
208
-
209
- # if text is not None:
210
- # pass
211
- # pos = QtCore.QPoint(50, 50)
212
- # painter = QPainter(self)
213
- # painter.drawText(pos, text)
214
- # painter.setPen(QColor(color, color, color))
215
187
  self.setPixmap(QPixmap(image))
216
188
 
217
189
  def update_image_scaling_factors(self):
@@ -233,19 +205,9 @@ class PButton(QtWidgets.QPushButton):
233
205
  self.setToolTip(tip)
234
206
  self.night_mode_switch(night_mode)
235
207
  self.setFont(buttonfont)
236
- # self.setStyleSheet("background-color: rgb(50,50,65);\n" #50,50,65 150, 150, 150 153, 204, 205 122, 0, 61 30, 144, 220
237
- # "border-color: rgb(255, 255, 255);\n"
238
- # "color: rgb(255, 255, 255);\n"
239
- # "font: 17pt \"Segoe UI Semibold\";\n"
240
- # "border : 1px solid rgb(255, 255, 255);"
241
- # "border-radius : 12px;\n"
242
- # )
243
208
  self.setSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
244
209
  self.setFixedWidth(len(text)*15 + 25)
245
210
  self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
246
- # if fade:
247
- # # self.mouseMoveEvent.connect(self.fade)
248
- # self.clicked.connect(self.fade)
249
211
 
250
212
  def night_mode_switch(self, night_mode):
251
213
  if night_mode:
@@ -322,7 +284,6 @@ class Spinbox(QtWidgets.QWidget):
322
284
 
323
285
  self._line_edit = QtWidgets.QLineEdit(self)
324
286
  self._line_edit.setAlignment(QtCore.Qt.AlignLeft)
325
- # self._line_edit.setAlignment(QtCore.Qt.AlignRight)
326
287
  self._layout.addWidget(self._line_edit)
327
288
 
328
289
  button_layout = QtWidgets.QVBoxLayout()
@@ -354,17 +315,11 @@ class Spinbox(QtWidgets.QWidget):
354
315
  self.decimals = decimals
355
316
  if decimals is not None:
356
317
  self.setDecimals(decimals)
357
- # self.setStepType(QtWidgets.QAbstractSpinBox.AdaptiveDecimalStepType)
358
318
  else:
359
319
  self.setDecimals(0)
360
320
  self.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
361
321
  self.setFont(QFont(textfont, textsize, QFont.Medium))
362
322
  self.night_mode_switch(night_mode)
363
- # self.setStyleSheet("""
364
- # QSpinBox::up-button { subcontrol-origin: border; subcontrol-position: top right; width: 16px; }
365
- # QSpinBox::down-button { subcontrol-origin: border; subcontrol-position: bottom right; width: 16px; }
366
- # QSpinBox::up-arrow, QSpinBox::down-arrow { width: 10px; height: 10px; }
367
- # """)
368
323
 
369
324
  self.setStyleSheet("""
370
325
  QPushButton {
@@ -479,18 +434,9 @@ class Combobox(QtWidgets.QComboBox):
479
434
  if current_idx is not None:
480
435
  self.setCurrentIndex(current_idx)
481
436
  self.setFixedHeight(30)
482
- #self.adjustSize()
483
- #max([len(item) for item in items_list])
484
- # width = self.minimumSizeHint().width()
485
- # self.setMinimumWidth(width+30)
486
- # self.setFixedWidth(self.minimumSizeHint().width() + 5)
487
-
488
- # self.setSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum)
489
437
  self.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
490
438
  self.night_mode_switch(night_mode)
491
439
 
492
- # self.setStyleSheet("QComboBox::drop - down:!editable{background: transparent; border: none;};"
493
- # "QComboBox {border: '1px solid rgb(127, 127, 127)'; border-radius: 4px}")
494
440
  self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
495
441
  def night_mode_switch(self, night_mode):
496
442
  if night_mode:
@@ -543,11 +489,8 @@ class EditText(QtWidgets.QLineEdit):
543
489
  self.setText(str(text))
544
490
  self.night_mode_switch(night_mode)
545
491
  self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
546
- # self.setAttribute(QtCore.Qt.WA_MacShowFocusRect, 0)
547
492
 
548
493
  def night_mode_switch(self, night_mode):
549
- # self.setStyleSheet("border: %s" % bordercolor)
550
- # self.setStyleSheet("border: %s" % night_border_color)
551
494
  if night_mode:
552
495
  self.setStyleSheet(
553
496
  "background-color: %s; color: %s; font: %s; border-bottom: %s; border-top: %s" % (
@@ -557,26 +500,6 @@ class EditText(QtWidgets.QLineEdit):
557
500
  "background-color: %s; color: %s; font: %s; border-bottom: %s; border-top: %s" % (
558
501
  backgroundcolor, textColor, f"{textsize}pt {textfont};", f"1px solid grey", f"1px dotted #adadad"))
559
502
 
560
- # "QLineEdit"
561
- # "{"
562
- # "border : 5px solid black;"
563
- # "}"
564
- # "QLineEdit::hover"
565
- # "{"
566
- # "border-color : red green blue yellow"
567
- # "}")
568
-
569
- # if night_mode:
570
- # self.setStyleSheet(
571
- # "background-color: %s; color: %s; font: %s; border-color: %s; selection-color: %s; alternate-border-color: %s; selection-background-color: %s" % (
572
- # night_background_color, night_text_Color, f"{textsize}pt {textfont};", night_border_color,
573
- # night_selection_color, night_selection_border_color, night_selection_background_color))
574
- # else:
575
- # self.setStyleSheet(
576
- # "background-color: %s; color: %s; font: %s; border-color: %s; selection-color: %s; alternate-border-color: %s; selection-background-color: %s" % (
577
- # backgroundcolor, textColor, f"{textsize}pt {textfont};", bordercolor, selectioncolor,
578
- # selectionbordercolor, selectionbackgroundcolor))
579
-
580
503
 
581
504
  class FixedText(QtWidgets.QLabel):
582
505
  def __init__(self, text, police=None, halign='l', valign="c", tip=None, night_mode=False):
@@ -597,18 +520,8 @@ class FixedText(QtWidgets.QLabel):
597
520
 
598
521
  if police is not None:
599
522
  if police > 23:
600
- # self.setStyleSheet("font: %s; margin-bottom: %s" % (titlefont, "30%;"))
601
-
602
- # self.night_mode_switch(night_mode, titlefont)
603
523
  self.night_mode_switch(night_mode, f"{police}pt {titlefont}")
604
-
605
- # self.setFont(titlefont)
606
- # self.setStyleSheet("margin-bottom: 30%;\n")
607
524
  self.setMargin(2)
608
- # else:
609
- # self.night_mode_switch(night_mode, f"{police}pt {textfont}")
610
- # self.night_mode_switch(night_mode, QFont(textfont, police + 2, QFont.Medium))
611
- # self.setFont(QFont(textfont, police + 2, QFont.Medium))
612
525
 
613
526
  else:
614
527
  self.setFont(QFont(textfont, textsize + 2, QFont.Medium))
@@ -624,12 +537,6 @@ class FixedText(QtWidgets.QLabel):
624
537
  border: black solid 1px
625
538
  }""")
626
539
 
627
- # self.setStyleSheet("""QToolTip {
628
- # background-color: rgb(150, 150, 150);
629
- # color: rgb(1, 1, 1);
630
- # border: black solid 1px
631
- # }""")
632
-
633
540
  def night_mode_switch(self, night_mode, font):
634
541
  if night_mode:
635
542
  self.setStyleSheet("font: %s; color: %s; margin-bottom: %s" % (font, night_text_Color, "30%"))
@@ -644,7 +551,6 @@ class LineWidget(QtWidgets.QWidget):
644
551
  self.line = QtWidgets.QFrame()
645
552
  if ori == "h":
646
553
  self.line.setFrameShape(QtWidgets.QFrame.HLine)
647
- # self.setFrameShadow(QtWidgets.QFrame.Sunken)
648
554
  else:
649
555
  self.line.setFrameShape(QtWidgets.QFrame.VLine)
650
556
  self.night_mode_switch(night_mode)
@@ -652,11 +558,9 @@ class LineWidget(QtWidgets.QWidget):
652
558
  size = [1, 4]
653
559
  self.line.setFixedHeight(size[0])
654
560
  self.line.setFixedWidth(size[1])
655
- horizontal_space = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding,
656
- QtWidgets.QSizePolicy.Maximum)
657
- self.layout.addItem(horizontal_space)
561
+ self.layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
658
562
  self.layout.addWidget(self.line)
659
- self.layout.addItem(horizontal_space)
563
+ self.layout.addItem(QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Maximum))
660
564
  self.setLayout(self.layout)
661
565
 
662
566
  def night_mode_switch(self, night_mode):
@@ -685,12 +589,9 @@ class MainTabsWidget(QtWidgets.QPushButton):
685
589
  self.state = "not_in_use" # States: "not_in_use", "in_use", "not_usable"
686
590
  self.setFont(buttonfont)
687
591
 
688
-
689
592
  # Set basic properties
690
593
  self.setSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Fixed)
691
- # self.setFixedWidth(len(text)*15 + 25)
692
594
  self.setFixedHeight(35)
693
- # self.setMinimumWidth(80)
694
595
  self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
695
596
 
696
597
  self.night_mode_switch(night_mode)