cellects 0.1.0__tar.gz → 0.1.3__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 (60) hide show
  1. {cellects-0.1.0/src/cellects.egg-info → cellects-0.1.3}/PKG-INFO +66 -22
  2. cellects-0.1.3/README.md +138 -0
  3. {cellects-0.1.0 → cellects-0.1.3}/pyproject.toml +2 -2
  4. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/config/all_vars_dict.py +2 -2
  5. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/core/cellects_paths.py +2 -1
  6. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/gui/advanced_parameters.py +24 -3
  7. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/gui/custom_widgets.py +12 -30
  8. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/gui/image_analysis_window.py +24 -3
  9. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/gui/required_output.py +5 -2
  10. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/gui/video_analysis_window.py +16 -20
  11. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/utils/load_display_save.py +2 -5
  12. {cellects-0.1.0 → cellects-0.1.3/src/cellects.egg-info}/PKG-INFO +66 -22
  13. {cellects-0.1.0 → cellects-0.1.3}/tests/test_integration.py +14 -12
  14. {cellects-0.1.0 → cellects-0.1.3}/tests/test_load_display_save.py +61 -91
  15. {cellects-0.1.0 → cellects-0.1.3}/tests/test_network_functions.py +2 -2
  16. {cellects-0.1.0 → cellects-0.1.3}/tests/test_utilitarian.py +4 -4
  17. cellects-0.1.0/README.md +0 -94
  18. {cellects-0.1.0 → cellects-0.1.3}/LICENSE.odt +0 -0
  19. {cellects-0.1.0 → cellects-0.1.3}/setup.cfg +0 -0
  20. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/__init__.py +0 -0
  21. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/__main__.py +0 -0
  22. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/config/__init__.py +0 -0
  23. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/core/__init__.py +0 -0
  24. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/core/cellects_threads.py +0 -0
  25. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/core/motion_analysis.py +0 -0
  26. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/core/one_image_analysis.py +0 -0
  27. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/core/one_video_per_blob.py +0 -0
  28. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/core/program_organizer.py +0 -0
  29. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/core/script_based_run.py +0 -0
  30. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/gui/__init__.py +0 -0
  31. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/gui/cellects.py +0 -0
  32. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/gui/first_window.py +0 -0
  33. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/gui/if_several_folders_window.py +0 -0
  34. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/icons/__init__.py +0 -0
  35. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/icons/cellects_icon.icns +0 -0
  36. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/icons/cellects_icon.ico +0 -0
  37. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/image_analysis/__init__.py +0 -0
  38. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/image_analysis/cell_leaving_detection.py +0 -0
  39. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/image_analysis/cluster_flux_study.py +0 -0
  40. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/image_analysis/image_segmentation.py +0 -0
  41. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/image_analysis/morphological_operations.py +0 -0
  42. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/image_analysis/network_functions.py +0 -0
  43. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/image_analysis/one_image_analysis_threads.py +0 -0
  44. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/image_analysis/progressively_add_distant_shapes.py +0 -0
  45. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/image_analysis/shape_descriptors.py +0 -0
  46. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/utils/__init__.py +0 -0
  47. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/utils/decorators.py +0 -0
  48. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/utils/formulas.py +0 -0
  49. {cellects-0.1.0 → cellects-0.1.3}/src/cellects/utils/utilitarian.py +0 -0
  50. {cellects-0.1.0 → cellects-0.1.3}/src/cellects.egg-info/SOURCES.txt +0 -0
  51. {cellects-0.1.0 → cellects-0.1.3}/src/cellects.egg-info/dependency_links.txt +0 -0
  52. {cellects-0.1.0 → cellects-0.1.3}/src/cellects.egg-info/entry_points.txt +0 -0
  53. {cellects-0.1.0 → cellects-0.1.3}/src/cellects.egg-info/requires.txt +0 -0
  54. {cellects-0.1.0 → cellects-0.1.3}/src/cellects.egg-info/top_level.txt +0 -0
  55. {cellects-0.1.0 → cellects-0.1.3}/tests/test_based_run.py +0 -0
  56. {cellects-0.1.0 → cellects-0.1.3}/tests/test_formulas.py +0 -0
  57. {cellects-0.1.0 → cellects-0.1.3}/tests/test_image_segmentation.py +0 -0
  58. {cellects-0.1.0 → cellects-0.1.3}/tests/test_morphological_operations.py +0 -0
  59. {cellects-0.1.0 → cellects-0.1.3}/tests/test_progressively_add_distant_shapes.py +0 -0
  60. {cellects-0.1.0 → cellects-0.1.3}/tests/test_shape_descriptors.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: cellects
3
- Version: 0.1.0
3
+ Version: 0.1.3
4
4
  Summary: Cell Expansion Computer Tracking Software.
5
5
  Author: Aurèle Boussard
6
6
  Project-URL: Homepage, https://github.com/Aurele-B/Cellects
@@ -8,7 +8,7 @@ Project-URL: Issues, https://github.com/Aurele-B/Cellects/issues
8
8
  Classifier: Programming Language :: Python :: 3
9
9
  Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
10
  Classifier: Operating System :: OS Independent
11
- Requires-Python: <3.13,>=3.11
11
+ Requires-Python: <3.14,>=3.11
12
12
  Description-Content-Type: text/markdown
13
13
  License-File: LICENSE.odt
14
14
  Requires-Dist: coloredlogs
@@ -48,40 +48,84 @@ automated computation of a variety of geometrical descriptors, easy installation
48
48
 
49
49
 
50
50
  ---
51
-
52
51
  ## Quick Start
52
+ ### 1. With Cellects_installer.exe (windows)
53
+ - Download [Cellects_installer.exe](https://drive.google.com/file/d/1v2ppaln0LJ5QhXXq1D-zduhfun5D2ZXX/view?usp=drive_link)
54
+ - Double-click on the Cellects_installer.exe file to start installation
55
+ Note 1: Windows may warn you that it's unsafe; that's normal, because we are not a registered developer. Click "More info" and "Run Anyway".
56
+ Note 2: For the same reason, some antivirus software can prevent installation.
53
57
 
58
+ - To run Cellects, explore the newly created folder to find and execute Cellects.exe
59
+ <br />
54
60
 
55
- ⚠️ **Note:** At this stage, Cellects is available **only from source**.
56
- You will need **Miniconda3** and **git** installed on your system.
57
-
58
- - Install [Miniconda3](https://docs.conda.io/en/latest/miniconda.html)
59
- (choose the installer for your operating system).
60
- - Install [git](https://git-scm.com/downloads)
61
- (also available through package managers like `apt`, `brew`, or `choco`).
61
+ ### 2. Using pip (Mac, Windows or Linux)
62
+ - Install [python 3.13](https://www.python.org/downloads/release/python-3139/)
62
63
 
63
- Once these prerequisites are installed, you can set up Cellects as follows:
64
+ - Best practice(optional): create and activate a python environment
65
+ Use a terminal to create the environment:
66
+ ```bash
67
+ cd path/toward/an/existing/folder/
68
+ python -m venv ./cellects_env
69
+ ```
70
+ Activation on Windows:
71
+ ```bash
72
+ cellects_env\Scripts\activate
73
+ ```
74
+ Activation on Unix or MacOS:
75
+ ```bash
76
+ source cellects_env/bin/activate
77
+ ```
64
78
 
79
+ - Installation:
65
80
  ```bash
66
- # Clone the repository
67
- git clone https://github.com/Aurele-B/Cellects.git
68
- cd Cellects
81
+ pip install cellects
82
+ ```
69
83
 
70
- # Create and activate the environment
71
- conda env create -f conda/env.yml
72
- conda activate cellects-dev
84
+ - Run Cellects:
85
+ ```bash
86
+ Cellects
87
+ ```
73
88
 
74
- # Install the package in editable mode
89
+ To uninstall, use:
90
+ ```bash
91
+ pip uninstall cellects
92
+ ```
93
+ Note: creating a python environment avoids compatibilities issues with other python scripts.
94
+ However, the user have to activate this environment every time before running Cellects.
95
+
96
+ ### 3. To access the source code (Mac, Windows or Linux)
97
+ - Install [python 3.13](https://www.python.org/downloads/release/python-3139/)
98
+ - Install [git](https://git-scm.com/downloads)
99
+ - On Mac: also install [brew](https://brew.sh/)
100
+ - Choose a place to install Cellects and use a terminal to write:
101
+ ```bash
102
+ cd path/toward/an/existing/folder/
103
+ ```
104
+ Note: The repository will be cloned to that folder; if updating an existing project, use a different folder name and rename it after verifying the new version.
105
+ - Clone [Cellects repository](https://github.com/Aurele-B/Cellects.git) in terminal (or any IDE) with:
106
+ ```bash
107
+ git clone https://github.com/Aurele-B/Cellects.git
108
+ cd ./Cellects
109
+ pip install --upgrade pip
110
+ python -m venv ./cellects_env
111
+ ```
112
+ On Windows, run:
113
+ ```bash
114
+ cellects_env\Scripts\activate
115
+ ```
116
+ On Unix or MacOS, run:
117
+ ```bash
118
+ source cellects_env/bin/activate
119
+ ```
120
+ Install Cellects dependencies in editable mode:
121
+ ```bash
75
122
  pip install -e .
76
123
  ```
77
-
78
- Launch the application:
124
+ Run Cellects:
79
125
  ```bash
80
126
  Cellects
81
127
  ```
82
128
 
83
- ---
84
-
85
129
  ## Developer Guide
86
130
 
87
131
  ### Run Tests
@@ -0,0 +1,138 @@
1
+ Cellects: Cell Expansion Computer Tracking Software
2
+ ===================================================
3
+
4
+ Description
5
+ -----------
6
+
7
+ Cellects is a tracking software for organisms whose shape and size change over time.
8
+ Cellects’ main strengths are its broad scope of action,
9
+ automated computation of a variety of geometrical descriptors, easy installation and user-friendly interface.
10
+
11
+
12
+ ---
13
+ ## Quick Start
14
+ ### 1. With Cellects_installer.exe (windows)
15
+ - Download [Cellects_installer.exe](https://drive.google.com/file/d/1v2ppaln0LJ5QhXXq1D-zduhfun5D2ZXX/view?usp=drive_link)
16
+ - Double-click on the Cellects_installer.exe file to start installation
17
+ Note 1: Windows may warn you that it's unsafe; that's normal, because we are not a registered developer. Click "More info" and "Run Anyway".
18
+ Note 2: For the same reason, some antivirus software can prevent installation.
19
+
20
+ - To run Cellects, explore the newly created folder to find and execute Cellects.exe
21
+ <br />
22
+
23
+ ### 2. Using pip (Mac, Windows or Linux)
24
+ - Install [python 3.13](https://www.python.org/downloads/release/python-3139/)
25
+
26
+ - Best practice(optional): create and activate a python environment
27
+ Use a terminal to create the environment:
28
+ ```bash
29
+ cd path/toward/an/existing/folder/
30
+ python -m venv ./cellects_env
31
+ ```
32
+ Activation on Windows:
33
+ ```bash
34
+ cellects_env\Scripts\activate
35
+ ```
36
+ Activation on Unix or MacOS:
37
+ ```bash
38
+ source cellects_env/bin/activate
39
+ ```
40
+
41
+ - Installation:
42
+ ```bash
43
+ pip install cellects
44
+ ```
45
+
46
+ - Run Cellects:
47
+ ```bash
48
+ Cellects
49
+ ```
50
+
51
+ To uninstall, use:
52
+ ```bash
53
+ pip uninstall cellects
54
+ ```
55
+ Note: creating a python environment avoids compatibilities issues with other python scripts.
56
+ However, the user have to activate this environment every time before running Cellects.
57
+
58
+ ### 3. To access the source code (Mac, Windows or Linux)
59
+ - Install [python 3.13](https://www.python.org/downloads/release/python-3139/)
60
+ - Install [git](https://git-scm.com/downloads)
61
+ - On Mac: also install [brew](https://brew.sh/)
62
+ - Choose a place to install Cellects and use a terminal to write:
63
+ ```bash
64
+ cd path/toward/an/existing/folder/
65
+ ```
66
+ Note: The repository will be cloned to that folder; if updating an existing project, use a different folder name and rename it after verifying the new version.
67
+ - Clone [Cellects repository](https://github.com/Aurele-B/Cellects.git) in terminal (or any IDE) with:
68
+ ```bash
69
+ git clone https://github.com/Aurele-B/Cellects.git
70
+ cd ./Cellects
71
+ pip install --upgrade pip
72
+ python -m venv ./cellects_env
73
+ ```
74
+ On Windows, run:
75
+ ```bash
76
+ cellects_env\Scripts\activate
77
+ ```
78
+ On Unix or MacOS, run:
79
+ ```bash
80
+ source cellects_env/bin/activate
81
+ ```
82
+ Install Cellects dependencies in editable mode:
83
+ ```bash
84
+ pip install -e .
85
+ ```
86
+ Run Cellects:
87
+ ```bash
88
+ Cellects
89
+ ```
90
+
91
+ ## Developer Guide
92
+
93
+ ### Run Tests
94
+ Cellects uses `pytest` + `pytest-cov`.
95
+ Install test dependencies:
96
+
97
+ ```bash
98
+ pip install -e ".[test]"
99
+ ```
100
+
101
+ Run the test suite (with coverage enabled by default via `pyproject.toml`):
102
+
103
+ ```bash
104
+ pytest
105
+ ```
106
+
107
+ You can access the coverage report with `coverage html` and open `htmlcov/index.html` in your browser.
108
+
109
+ ```bash
110
+ open htmlcov/index.html # macOS
111
+ xdg-open htmlcov/index.html # Linux
112
+ start htmlcov\index.html # Windows (PowerShell)
113
+ ```
114
+
115
+ Or explicitly:
116
+ ```bash
117
+ pytest --cov=src/cellects --cov-report=term-missing
118
+ ```
119
+
120
+ ### Build Documentation
121
+ Install doc dependencies:
122
+
123
+ ```bash
124
+ pip install -e ".[doc]"
125
+ ```
126
+
127
+ Serve the docs locally:
128
+ ```bash
129
+ mkdocs serve
130
+ ```
131
+
132
+ Open [http://127.0.0.1:8000](http://127.0.0.1:8000) in your browser.
133
+
134
+ ---
135
+
136
+ ## Resources
137
+ - [User manual](https://github.com/Aurele-B/Cellects/blob/main/_old_doc/UserManual.md)
138
+ - [Usage example (video)](https://www.youtube.com/watch?v=N-k4p_aSPC0)
@@ -4,11 +4,11 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "cellects"
7
- version = "0.1.0"
7
+ version = "0.1.3"
8
8
  description = "Cell Expansion Computer Tracking Software."
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
11
- requires-python = ">=3.11,<3.13"
11
+ requires-python = ">=3.11,<3.14"
12
12
  authors = [{ name = "Aurèle Boussard" }]
13
13
  classifiers = [
14
14
  "Programming Language :: Python :: 3",
@@ -12,7 +12,7 @@ from cellects.image_analysis.shape_descriptors import descriptors_categories, de
12
12
  import numpy as np
13
13
  from cellects.core.cellects_paths import ALL_VARS_PKL_FILE
14
14
  from cellects.utils.load_display_save import PickleRick
15
- from cellects.core.cellects_paths import TEST_DIR
15
+ from cellects.core.cellects_paths import EXPERIMENTS_DIR
16
16
 
17
17
 
18
18
  class DefaultDicts:
@@ -46,7 +46,7 @@ class DefaultDicts:
46
46
  'first_folder_sample_number': 1,
47
47
  'first_move_threshold_in_mm²': 10,
48
48
  'folder_list': [],
49
- 'global_pathway': str(TEST_DIR / "experiment"),
49
+ 'global_pathway': str(EXPERIMENTS_DIR),
50
50
  'im_or_vid': 0,
51
51
  'image_horizontal_size_in_mm': 700,
52
52
  'minimal_appearance_size': 10,
@@ -20,10 +20,11 @@ IMAGE_ANALYSIS_DIR = CELLECTS_DIR / "image_analysis"
20
20
  UTILS_DIR = CELLECTS_DIR / "utils"
21
21
 
22
22
  # Repo root (src/..)
23
- REPO_ROOT = CELLECTS_DIR.parent
23
+ 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
28
  TEST_DIR = REPO_ROOT / "tests"
28
29
 
29
30
  # Example packaged file
@@ -214,9 +214,23 @@ class AdvancedParameters(WindowType):
214
214
  # self.min_size_for_connection.setVisible(do_use_min_size)
215
215
  # self.min_size_for_connection_label.setVisible(do_use_min_size)
216
216
 
217
- self.use_min_size.setStyleSheet("margin-left:100%; margin-right:0%;")
217
+ self.use_min_size.setStyleSheet("QCheckBox::indicator {width: 12px;height: 12px;background-color: transparent;"
218
+ "border-radius: 5px;border-style: solid;border-width: 1px;"
219
+ "border-color: rgb(100,100,100);}"
220
+ "QCheckBox::indicator:checked {background-color: rgb(70,130,180);}"
221
+ "QCheckBox:checked, QCheckBox::indicator:checked {border-color: black black white white;}"
222
+ "QCheckBox:checked {background-color: transparent;}"
223
+ "QCheckBox:margin-left {100%}"
224
+ "QCheckBox:margin-right {0%}")
218
225
  self.min_size_for_connection_label.setAlignment(QtCore.Qt.AlignRight)
219
- self.use_max_size.setStyleSheet("margin-left:100%; margin-right:0%;")
226
+ self.use_max_size.setStyleSheet("QCheckBox::indicator {width: 12px;height: 12px;background-color: transparent;"
227
+ "border-radius: 5px;border-style: solid;border-width: 1px;"
228
+ "border-color: rgb(100,100,100);}"
229
+ "QCheckBox::indicator:checked {background-color: rgb(70,130,180);}"
230
+ "QCheckBox:checked, QCheckBox::indicator:checked {border-color: black black white white;}"
231
+ "QCheckBox:checked {background-color: transparent;}"
232
+ "QCheckBox:margin-left {100%}"
233
+ "QCheckBox:margin-right {0%}")
220
234
  self.max_size_for_connection_label.setAlignment(QtCore.Qt.AlignRight)
221
235
 
222
236
  # II/D/ Arrange widgets in the box
@@ -838,7 +852,14 @@ class AdvancedParameters(WindowType):
838
852
  self.more_than_2_colors_widget = QtWidgets.QWidget()
839
853
  self.more_than_2_colors_layout = QtWidgets.QHBoxLayout()
840
854
  self.more_than_two_colors = Checkbox(self.parent().po.all["more_than_two_colors"])
841
- self.more_than_two_colors.setStyleSheet("margin-left:0%; margin-right:-10%;")
855
+ self.more_than_two_colors.setStyleSheet("QCheckBox::indicator {width: 12px;height: 12px;background-color: transparent;"
856
+ "border-radius: 5px;border-style: solid;border-width: 1px;"
857
+ "border-color: rgb(100,100,100);}"
858
+ "QCheckBox::indicator:checked {background-color: rgb(70,130,180);}"
859
+ "QCheckBox:checked, QCheckBox::indicator:checked {border-color: black black white white;}"
860
+ "QCheckBox:checked {background-color: transparent;}"
861
+ "QCheckBox:margin-left {0%}"
862
+ "QCheckBox:margin-right {-10%}")
842
863
  self.more_than_two_colors.stateChanged.connect(self.display_more_than_two_colors_option)
843
864
 
844
865
  self.more_than_two_colors_label = FixedText("Heterogeneous back",
@@ -65,30 +65,12 @@ class WindowType(QtWidgets.QWidget):
65
65
  self.frame = QtWidgets.QFrame(self)
66
66
  self.frame.setGeometry(QtCore.QRect(0, 0, self.parent().screen_width, self.parent().screen_height))
67
67
  self.display_image = None
68
- # self.setFont(QFont(textfont, textsize, QFont.Medium))
69
- # self.setStyleSheet("background-color: %s; color: %s; font: %s; border-color: %s; selection-color: %s; selection-background-color: %s" % (backgroundcolor, textColor, f"{textsize}pt {textfont};", bordercolor, selectioncolor, selectionbackgroundcolor))
70
- # self.setStyleSheet("background-color: %s; color: %s; border-color: %s; selection-color: %s; selection-background-color: %s" % (backgroundcolor, textColor, bordercolor, selectioncolor, selectionbackgroundcolor))
71
-
72
68
  self.setFont(QFont(textfont, textsize, QFont.Medium))
73
69
  self.night_mode_switch(night_mode)
74
- # self.setStyleSheet("background-color: rgb(50,50,65);"
75
- # "color: rgb(255, 255, 255);\n" # 213, 251, 255
76
- # "font: 15pt \"Calibri\";\n"
77
- # "border-color: rgb(50,50,65);\n"
78
- # # "border-color: rgb(0, 150, 75);\n"
79
- # "selection-color: rgb(1, 152, 117);\n" # 0, 150, 75 0, 132, 66 0, 120, 215
80
- # "selection-background-color:rgb(50,50,65);\n" # jsp
81
- # )
82
- # "selection-background-color:rgb(60, 60, 60);\n" # jsp
83
- # "alternate-background-color: rgb(54, 54, 54);\n" # jsp
84
- # "QToolTip { color: rgb(1, 152, 117); background-color: rgb(64,64,64); border: 0px; };\n"
85
- # "")
86
- # self.titles_font = "font: 24pt"
87
70
  self.horizontal_space = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.MinimumExpanding,
88
71
  QtWidgets.QSizePolicy.Maximum)
89
72
  self.vertical_space = QtWidgets.QSpacerItem(1, 1, QtWidgets.QSizePolicy.Maximum,
90
73
  QtWidgets.QSizePolicy.MinimumExpanding)
91
- # self.resized.connect(self.center_window)
92
74
 
93
75
  def resizeEvent(self, event):
94
76
  '''
@@ -116,13 +98,13 @@ class WindowType(QtWidgets.QWidget):
116
98
  def night_mode_switch(self, night_mode):
117
99
  if night_mode:
118
100
  self.setStyleSheet(
119
- "background-color: %s; color: %s; font: %s; border-color: %s; selection-color: %s; selection-background-color: %s" % (
120
- night_background_color, night_text_Color, f"{textsize}pt {textfont};", night_border_color,
101
+ "background-color: %s; color: %s; font: %s; selection-color: %s; selection-background-color: %s" % (
102
+ night_background_color, night_text_Color, f"{textsize}pt {textfont};",
121
103
  night_selection_color, night_selection_background_color))
122
104
  else:
123
105
  self.setStyleSheet(
124
- "background-color: %s; color: %s; font: %s; border-color: %s; selection-color: %s; selection-background-color: %s" % (
125
- backgroundcolor, textColor, f"{textsize}pt {textfont};", bordercolor, selectioncolor,
106
+ "background-color: %s; color: %s; font: %s; selection-color: %s; selection-background-color: %s" % (
107
+ backgroundcolor, textColor, f"{textsize}pt {textfont};", selectioncolor,
126
108
  selectionbackgroundcolor))
127
109
 
128
110
 
@@ -487,12 +469,6 @@ class Spinbox(QtWidgets.QWidget):
487
469
  "background-color: %s; color: %s; border-color: %s; border: %s; border-radius: %s" % (
488
470
  backgroundcolor, textColor, bordercolor, rollingborder, rollingangles))
489
471
 
490
- # self.setStyleSheet("background-color: rgb(50,50,65);\n"
491
- # "font: 16pt \"Calibri\";\n"
492
- # "border-color: rgb(50,50,65);\n"
493
- # # "border-color: rgb(255, 255, 255);\n"
494
- # "color: rgb(213, 251, 255);\n")
495
-
496
472
 
497
473
  class Combobox(QtWidgets.QComboBox):
498
474
  def __init__(self, items_list, current_idx=None, night_mode=False):
@@ -530,8 +506,14 @@ class Checkbox(QtWidgets.QCheckBox):
530
506
  self.setChecked(set_checked)
531
507
  self.setSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
532
508
  self.setMinimumWidth(75)
533
- # self.setStyleSheet("padding:5px")
534
- self.setStyleSheet("margin-left:50%; margin-right:50%;")
509
+ self.setStyleSheet("QCheckBox::indicator {width: 12px;height: 12px;background-color: transparent;"
510
+ "border-radius: 5px;border-style: solid;border-width: 1px;"
511
+ "border-color: rgb(100,100,100);}"
512
+ "QCheckBox::indicator:checked {background-color: rgb(70,130,180);}"
513
+ "QCheckBox:checked, QCheckBox::indicator:checked {border-color: black black white white;}"
514
+ "QCheckBox:checked {background-color: transparent;}"
515
+ "QCheckBox:margin-left {50%}"
516
+ "QCheckBox:margin-right {50%}")
535
517
  self.setCursor(QtCore.Qt.CursorShape.PointingHandCursor)
536
518
 
537
519
 
@@ -1156,7 +1156,14 @@ class ImageAnalysisWindow(MainTabsType):
1156
1156
  self.advanced_mode_widget = QtWidgets.QWidget()
1157
1157
  self.advanced_mode_layout = QtWidgets.QHBoxLayout()
1158
1158
  self.advanced_mode_cb = Checkbox(self.parent().po.all['expert_mode'])
1159
- self.advanced_mode_cb.setStyleSheet("margin-left:0%; margin-right:0%;")
1159
+ self.advanced_mode_cb.setStyleSheet("QCheckBox::indicator {width: 12px;height: 12px;background-color: transparent;"
1160
+ "border-radius: 5px;border-style: solid;border-width: 1px;"
1161
+ "border-color: rgb(100,100,100);}"
1162
+ "QCheckBox::indicator:checked {background-color: rgb(70,130,180);}"
1163
+ "QCheckBox:checked, QCheckBox::indicator:checked {border-color: black black white white;}"
1164
+ "QCheckBox:checked {background-color: transparent;}"
1165
+ "QCheckBox:margin-left {0%}"
1166
+ "QCheckBox:margin-right {0%}")
1160
1167
  self.advanced_mode_cb.stateChanged.connect(self.advanced_mode_check)
1161
1168
  self.advanced_mode_label = FixedText('Advanced mode', halign='l',
1162
1169
  tip="Display the color space combination corresponding to the selected option",
@@ -1380,7 +1387,14 @@ class ImageAnalysisWindow(MainTabsType):
1380
1387
  except KeyError:
1381
1388
  self.parent().po.vars["grid_segmentation"] = False
1382
1389
  self.grid_segmentation = Checkbox(self.parent().po.vars["grid_segmentation"])
1383
- self.grid_segmentation.setStyleSheet("margin-left:0%; margin-right:-10%;")
1390
+ self.grid_segmentation.setStyleSheet("QCheckBox::indicator {width: 12px;height: 12px;background-color: transparent;"
1391
+ "border-radius: 5px;border-style: solid;border-width: 1px;"
1392
+ "border-color: rgb(100,100,100);}"
1393
+ "QCheckBox::indicator:checked {background-color: rgb(70,130,180);}"
1394
+ "QCheckBox:checked, QCheckBox::indicator:checked {border-color: black black white white;}"
1395
+ "QCheckBox:checked {background-color: transparent;}"
1396
+ "QCheckBox:margin-left {0%}"
1397
+ "QCheckBox:margin-right {-10%}")
1384
1398
  self.grid_segmentation.stateChanged.connect(self.grid_segmentation_option)
1385
1399
 
1386
1400
  self.grid_segmentation_label = FixedText("Grid segmentation",
@@ -1399,7 +1413,14 @@ class ImageAnalysisWindow(MainTabsType):
1399
1413
  self.more_than_2_colors_widget = QtWidgets.QWidget()
1400
1414
  self.more_than_2_colors_layout = QtWidgets.QHBoxLayout()
1401
1415
  self.more_than_two_colors = Checkbox(self.parent().po.all["more_than_two_colors"])
1402
- self.more_than_two_colors.setStyleSheet("margin-left:0%; margin-right:-10%;")
1416
+ self.more_than_two_colors.setStyleSheet("QCheckBox::indicator {width: 12px;height: 12px;background-color: transparent;"
1417
+ "border-radius: 5px;border-style: solid;border-width: 1px;"
1418
+ "border-color: rgb(100,100,100);}"
1419
+ "QCheckBox::indicator:checked {background-color: rgb(70,130,180);}"
1420
+ "QCheckBox:checked, QCheckBox::indicator:checked {border-color: black black white white;}"
1421
+ "QCheckBox:checked {background-color: transparent;}"
1422
+ "QCheckBox:margin-left {0%}"
1423
+ "QCheckBox:margin-right {-10%}")
1403
1424
  self.more_than_two_colors.stateChanged.connect(self.display_more_than_two_colors_option)
1404
1425
 
1405
1426
  self.more_than_two_colors_label = FixedText("More than two colors",
@@ -4,12 +4,12 @@ This module contains the widget allowing the user to set which variables Cellect
4
4
  A first kind of variable is raw data: presence/absence coordinates of the specimens, network, oscillating pixels
5
5
  A second kind of variable describe the specimen at each time frame and for each arena of the image stack or video
6
6
  """
7
-
7
+ import numpy as np
8
8
  from PySide6 import QtWidgets, QtCore
9
9
  import logging
10
10
  from cellects.gui.custom_widgets import (
11
11
  WindowType, PButton, Checkbox, FixedText)
12
- from cellects.image_analysis.shape_descriptors import descriptors_names_to_display
12
+ from cellects.image_analysis.shape_descriptors import descriptors_names_to_display, descriptors_categories
13
13
 
14
14
 
15
15
  class RequiredOutput(WindowType):
@@ -136,6 +136,9 @@ class RequiredOutput(WindowType):
136
136
  showing the presence/absence of the cell/colony at one time frame.
137
137
  This function
138
138
  """
139
+ if not np.array_equal(self.parent().po.all['descriptors'], list(descriptors_categories.keys())):
140
+ self.parent().po.all['descriptors'] = descriptors_categories
141
+
139
142
  descriptor_names = self.parent().po.all['descriptors']
140
143
 
141
144
  for i, name in enumerate(descriptor_names):
@@ -190,7 +190,14 @@ class VideoAnalysisWindow(MainTabsType):
190
190
  tip='Uncheck to do a Post processing on only one option and earn computation time\nSelecting one of the remaining options will display the result from a Detection',
191
191
  night_mode=self.parent().po.all['night_mode'])
192
192
  self.compute_all_options_cb = Checkbox(self.parent().po.all['compute_all_options'])
193
- self.compute_all_options_cb.setStyleSheet("margin-left:0%; margin-right:0%;")
193
+ self.compute_all_options_cb.setStyleSheet("QCheckBox::indicator {width: 12px;height: 12px;background-color: transparent;"
194
+ "border-radius: 5px;border-style: solid;border-width: 1px;"
195
+ "border-color: rgb(100,100,100);}"
196
+ "QCheckBox::indicator:checked {background-color: rgb(70,130,180);}"
197
+ "QCheckBox:checked, QCheckBox::indicator:checked {border-color: black black white white;}"
198
+ "QCheckBox:checked {background-color: transparent;}"
199
+ "QCheckBox:margin-left {0%}"
200
+ "QCheckBox:margin-right {0%}")
194
201
  self.compute_all_options_cb.stateChanged.connect(self.compute_all_options_check)
195
202
  self.all_options_row_widget = QtWidgets.QWidget()
196
203
  self.all_options_row_layout = QtWidgets.QHBoxLayout()
@@ -234,7 +241,14 @@ class VideoAnalysisWindow(MainTabsType):
234
241
  self.fading_widget = QtWidgets.QWidget()
235
242
  self.fading_layout = QtWidgets.QHBoxLayout()
236
243
  self.do_fading = Checkbox(self.parent().po.vars['do_fading'])
237
- self.do_fading.setStyleSheet("margin-left:0%; margin-right:0%;")
244
+ self.do_fading.setStyleSheet("QCheckBox::indicator {width: 12px;height: 12px;background-color: transparent;"
245
+ "border-radius: 5px;border-style: solid;border-width: 1px;"
246
+ "border-color: rgb(100,100,100);}"
247
+ "QCheckBox::indicator:checked {background-color: rgb(70,130,180);}"
248
+ "QCheckBox:checked, QCheckBox::indicator:checked {border-color: black black white white;}"
249
+ "QCheckBox:checked {background-color: transparent;}"
250
+ "QCheckBox:margin-left {0%}"
251
+ "QCheckBox:margin-right {0%}")
238
252
  self.do_fading.stateChanged.connect(self.do_fading_check)
239
253
  self.fading = Spinbox(min=- 1, max=1, val=self.parent().po.vars['fading'], decimals=2,
240
254
  night_mode=self.parent().po.all['night_mode'])
@@ -274,24 +288,6 @@ class VideoAnalysisWindow(MainTabsType):
274
288
  self.last_options_layout = QtWidgets.QHBoxLayout()
275
289
  self.last_options_layout.addItem(self.horizontal_space)
276
290
 
277
- # # advanced mode widget
278
- # self.advanced_mode_widget = QtWidgets.QWidget()
279
- # self.advanced_mode_layout = QtWidgets.QHBoxLayout()
280
- # advanced_mode = self.parent().po.all['expert_mode']
281
- # self.advanced_mode_cb = Checkbox(self.parent().po.all['expert_mode'])
282
- # self.advanced_mode_cb.setStyleSheet("margin-left:0%; margin-right:0%;")
283
- # self.advanced_mode_cb.stateChanged.connect(self.advanced_mode_check)
284
- # self.advanced_mode_label = FixedText('Go to step 2 directly', align='l',
285
- # tip="Allow the user to try Post processing before having tuned the parameters related to Detection.",
286
- # night_mode=self.parent().po.all['night_mode'])
287
- # # self.advanced_mode_label.setAlignment(QtCore.Qt.AlignTop)
288
- # self.advanced_mode_layout.addWidget(self.advanced_mode_cb)
289
- # self.advanced_mode_layout.addWidget(self.advanced_mode_label)
290
- # self.advanced_mode_layout.addItem(self.horizontal_space)
291
- # self.advanced_mode_layout.setAlignment(QtCore.Qt.AlignHCenter)
292
- # self.advanced_mode_widget.setLayout(self.advanced_mode_layout)
293
- # self.last_options_layout.addWidget(self.advanced_mode_widget)
294
-
295
291
  self.advanced_parameters = PButton('Advanced Parameters', night_mode=self.parent().po.all['night_mode'])
296
292
  self.advanced_parameters.clicked.connect(self.advanced_parameters_is_clicked)
297
293
  self.last_options_layout.addWidget(self.advanced_parameters)
@@ -220,10 +220,6 @@ class PickleRick:
220
220
  Examples
221
221
  --------
222
222
  >>> PickleRick().read_file("example.pkl")
223
- Some content
224
-
225
- >>> read_file("non_existent_file.pkl")
226
- None
227
223
  """
228
224
  self.counter += 1
229
225
  if self.counter < 1000:
@@ -919,7 +915,8 @@ def save_fig(img: NDArray, full_path, cmap=None):
919
915
  else:
920
916
  ax.imshow(img, cmap=cmap, interpolation="none")
921
917
  plt.axis('off')
922
- fig.tight_layout()
918
+ if np.min(img.shape) > 50:
919
+ fig.tight_layout()
923
920
 
924
921
  fig.savefig(full_path, bbox_inches='tight', pad_inches=0., transparent=True, dpi=500)
925
922
  plt.close(fig)