cellects 0.1.2__py3-none-any.whl → 0.2.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. cellects/__main__.py +65 -25
  2. cellects/config/all_vars_dict.py +18 -17
  3. cellects/core/cellects_threads.py +1034 -396
  4. cellects/core/motion_analysis.py +1664 -2010
  5. cellects/core/one_image_analysis.py +1082 -1061
  6. cellects/core/program_organizer.py +1687 -1316
  7. cellects/core/script_based_run.py +80 -76
  8. cellects/gui/advanced_parameters.py +390 -330
  9. cellects/gui/cellects.py +102 -91
  10. cellects/gui/custom_widgets.py +16 -33
  11. cellects/gui/first_window.py +226 -104
  12. cellects/gui/if_several_folders_window.py +117 -68
  13. cellects/gui/image_analysis_window.py +866 -454
  14. cellects/gui/required_output.py +104 -57
  15. cellects/gui/ui_strings.py +840 -0
  16. cellects/gui/video_analysis_window.py +333 -155
  17. cellects/image_analysis/cell_leaving_detection.py +64 -4
  18. cellects/image_analysis/image_segmentation.py +451 -22
  19. cellects/image_analysis/morphological_operations.py +2166 -1635
  20. cellects/image_analysis/network_functions.py +616 -253
  21. cellects/image_analysis/one_image_analysis_threads.py +94 -153
  22. cellects/image_analysis/oscillations_functions.py +131 -0
  23. cellects/image_analysis/progressively_add_distant_shapes.py +2 -3
  24. cellects/image_analysis/shape_descriptors.py +517 -466
  25. cellects/utils/formulas.py +169 -6
  26. cellects/utils/load_display_save.py +362 -109
  27. cellects/utils/utilitarian.py +86 -9
  28. cellects-0.2.6.dist-info/LICENSE +675 -0
  29. cellects-0.2.6.dist-info/METADATA +829 -0
  30. cellects-0.2.6.dist-info/RECORD +44 -0
  31. cellects/core/one_video_per_blob.py +0 -540
  32. cellects/image_analysis/cluster_flux_study.py +0 -102
  33. cellects-0.1.2.dist-info/LICENSE.odt +0 -0
  34. cellects-0.1.2.dist-info/METADATA +0 -132
  35. cellects-0.1.2.dist-info/RECORD +0 -44
  36. {cellects-0.1.2.dist-info → cellects-0.2.6.dist-info}/WHEEL +0 -0
  37. {cellects-0.1.2.dist-info → cellects-0.2.6.dist-info}/entry_points.txt +0 -0
  38. {cellects-0.1.2.dist-info → cellects-0.2.6.dist-info}/top_level.txt +0 -0
@@ -1,102 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- This script contains the class for studying oscillating clusters on videos in 2D
4
- """
5
- import cv2
6
- import numpy as np
7
- from numpy import (
8
- append, float32, sum, mean, zeros, empty, array, nonzero, unique,
9
- isin, logical_or, logical_not, greater, uint8,
10
- uint32, min, any, zeros)
11
- from cellects.image_analysis.morphological_operations import cross_33, get_minimal_distance_between_2_shapes
12
-
13
-
14
- class ClusterFluxStudy:
15
- """
16
-
17
- """
18
- def __init__(self, dims):
19
- self.dims = dims
20
-
21
- self.pixels_data = np.empty((4, 0), dtype=np.uint32)
22
- self.clusters_id = np.zeros(self.dims[1:], dtype=np.uint32)
23
- # self.alive_clusters_in_flux = np.empty(0, dtype=np.uint32)#list()
24
- self.cluster_total_number = 0
25
-
26
- def update_flux(self, t, contours, current_flux, period_tracking, clusters_final_data):
27
- # Save the data from pixels that are not anymore in efflux
28
- lost = np.greater(self.clusters_id > 0, current_flux > 0)
29
- # Some pixels of that cluster faded, save their data
30
- lost_data = np.nonzero(lost)
31
- lost_data = np.array((period_tracking[lost], # lost_coord[0], lost_coord[1],
32
- self.clusters_id[lost], lost_data[0], lost_data[1]), dtype=np.uint32)
33
- # Add this to the array containing the data of each cluster that are still alive
34
- self.pixels_data = np.append(self.pixels_data, lost_data, axis=1)
35
- # Stop considering these pixels in period_tracking because they switched
36
- period_tracking[lost] = 0
37
- current_period_tracking = np.zeros(self.dims[1:], dtype=bool)
38
- for curr_clust_id in np.unique(current_flux)[1:]:
39
- # Get all pixels that were in the same flux previously
40
- curr_clust = current_flux == curr_clust_id
41
- already = self.clusters_id * curr_clust
42
- new = np.greater(curr_clust, self.clusters_id > 0)
43
-
44
- if not np.any(already):
45
- # It is an entirely new cluster:
46
- cluster_pixels = new
47
- self.cluster_total_number += 1
48
- cluster_name = self.cluster_total_number
49
- else:
50
- # Check whether parts of that cluster correspond to several clusters in clusters_id
51
- cluster_names = np.unique(already)[1:]
52
- # keep only one cluster name to gather clusters that just became connected
53
- cluster_name = np.min(cluster_names)
54
- # Put the same cluster name for new ones and every pixels that were
55
- # a part of a cluster touching the current cluster
56
- cluster_pixels = np.logical_or(np.isin(self.clusters_id, cluster_names), new)
57
- # If they are more than one,
58
- if len(cluster_names) > 1:
59
- # Update these cluster names in pixels_data
60
- self.pixels_data[1, np.isin(self.pixels_data[1, :], cluster_names)] = cluster_name
61
- # Update clusters_id
62
- self.clusters_id[cluster_pixels] = cluster_name
63
- # Update period_tracking
64
- current_period_tracking[curr_clust] = True
65
-
66
- period_tracking[current_period_tracking] += 1
67
- # Remove lost pixels from clusters_id
68
- self.clusters_id[lost] = 0
69
- # Find out which clusters are still alive or not
70
- still_alive_clusters = np.isin(self.pixels_data[1, :], np.unique(self.clusters_id))
71
- clusters_to_archive = np.unique(self.pixels_data[1, np.logical_not(still_alive_clusters)])
72
- # store their data in clusters_final_data
73
- clusters_data = np.zeros((len(clusters_to_archive), 6), dtype=np.float32)
74
- for clust_i, cluster in enumerate(clusters_to_archive):
75
- cluster_bool = self.pixels_data[1, :] == cluster
76
- cluster_size = np.sum(cluster_bool)
77
- cluster_img = np.zeros(self.dims[1:], dtype=np.uint8)
78
- cluster_img[self.pixels_data[2, cluster_bool], self.pixels_data[3, cluster_bool]] = 1
79
- nb, im, stats, centro = cv2.connectedComponentsWithStats(cluster_img)
80
- if np.any(cv2.dilate(cluster_img, kernel=cross_33, borderType=cv2.BORDER_CONSTANT, borderValue=0) * contours):
81
- minimal_distance = 1
82
- else:
83
- if cluster_size > 200:
84
-
85
- eroded_cluster_img = cv2.erode(cluster_img, cross_33)
86
- cluster_img = np.nonzero(cluster_img - eroded_cluster_img)
87
- contours[cluster_img] = 2
88
- else:
89
- contours[self.pixels_data[2, cluster_bool], self.pixels_data[3, cluster_bool]] = 2
90
- # Get the minimal distance between the border of the cell(s) (noted 1 in contours)
91
- # and the border of the cluster in the cell(s) (now noted 2 in contours)
92
- minimal_distance = get_minimal_distance_between_2_shapes(contours)
93
- data_to_save = np.array([[np.mean(self.pixels_data[0, cluster_bool]), t,
94
- cluster_size, minimal_distance, centro[1, 0], centro[1, 1]]], dtype=np.float32)
95
- clusters_data[clust_i,:] = data_to_save
96
- # and remove their data from pixels_data
97
- clusters_final_data = np.append(clusters_final_data, clusters_data, axis=0)
98
- self.pixels_data = self.pixels_data[:, still_alive_clusters]
99
-
100
- return period_tracking, clusters_final_data
101
-
102
-
Binary file
@@ -1,132 +0,0 @@
1
- Metadata-Version: 2.2
2
- Name: cellects
3
- Version: 0.1.2
4
- Summary: Cell Expansion Computer Tracking Software.
5
- Author: Aurèle Boussard
6
- Project-URL: Homepage, https://github.com/Aurele-B/Cellects
7
- Project-URL: Issues, https://github.com/Aurele-B/Cellects/issues
8
- Classifier: Programming Language :: Python :: 3
9
- Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
10
- Classifier: Operating System :: OS Independent
11
- Requires-Python: <3.13,>=3.11
12
- Description-Content-Type: text/markdown
13
- License-File: LICENSE.odt
14
- Requires-Dist: coloredlogs
15
- Requires-Dist: exif
16
- Requires-Dist: ExifRead
17
- Requires-Dist: numba
18
- Requires-Dist: opencv-python
19
- Requires-Dist: pandas
20
- Requires-Dist: psutil
21
- Requires-Dist: PySide6>=6.5
22
- Requires-Dist: scipy
23
- Requires-Dist: screeninfo
24
- Requires-Dist: numpy>=1.26
25
- Requires-Dist: scikit-image
26
- Requires-Dist: tqdm
27
- Requires-Dist: h5py
28
- Requires-Dist: matplotlib
29
- Requires-Dist: natsort
30
- Provides-Extra: test
31
- Requires-Dist: pytest; extra == "test"
32
- Requires-Dist: pytest-env; extra == "test"
33
- Requires-Dist: pytest-cov; extra == "test"
34
- Provides-Extra: doc
35
- Requires-Dist: mkdocs; extra == "doc"
36
- Requires-Dist: mkdocs-material; extra == "doc"
37
- Requires-Dist: pymdown-extensions; extra == "doc"
38
-
39
- Cellects: Cell Expansion Computer Tracking Software
40
- ===================================================
41
-
42
- Description
43
- -----------
44
-
45
- Cellects is a tracking software for organisms whose shape and size change over time.
46
- Cellects’ main strengths are its broad scope of action,
47
- automated computation of a variety of geometrical descriptors, easy installation and user-friendly interface.
48
-
49
-
50
- ---
51
-
52
- ## Quick Start
53
-
54
-
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`).
62
-
63
- Once these prerequisites are installed, you can set up Cellects as follows:
64
-
65
- ```bash
66
- # Clone the repository
67
- git clone https://github.com/Aurele-B/Cellects.git
68
- cd Cellects
69
-
70
- # Create and activate the environment
71
- conda env create -f conda/env.yml
72
- conda activate cellects-dev
73
-
74
- # Install the package in editable mode
75
- pip install -e .
76
- ```
77
-
78
- Launch the application:
79
- ```bash
80
- Cellects
81
- ```
82
-
83
- ---
84
-
85
- ## Developer Guide
86
-
87
- ### Run Tests
88
- Cellects uses `pytest` + `pytest-cov`.
89
- Install test dependencies:
90
-
91
- ```bash
92
- pip install -e ".[test]"
93
- ```
94
-
95
- Run the test suite (with coverage enabled by default via `pyproject.toml`):
96
-
97
- ```bash
98
- pytest
99
- ```
100
-
101
- You can access the coverage report with `coverage html` and open `htmlcov/index.html` in your browser.
102
-
103
- ```bash
104
- open htmlcov/index.html # macOS
105
- xdg-open htmlcov/index.html # Linux
106
- start htmlcov\index.html # Windows (PowerShell)
107
- ```
108
-
109
- Or explicitly:
110
- ```bash
111
- pytest --cov=src/cellects --cov-report=term-missing
112
- ```
113
-
114
- ### Build Documentation
115
- Install doc dependencies:
116
-
117
- ```bash
118
- pip install -e ".[doc]"
119
- ```
120
-
121
- Serve the docs locally:
122
- ```bash
123
- mkdocs serve
124
- ```
125
-
126
- Open [http://127.0.0.1:8000](http://127.0.0.1:8000) in your browser.
127
-
128
- ---
129
-
130
- ## Resources
131
- - [User manual](https://github.com/Aurele-B/Cellects/blob/main/_old_doc/UserManual.md)
132
- - [Usage example (video)](https://www.youtube.com/watch?v=N-k4p_aSPC0)
@@ -1,44 +0,0 @@
1
- cellects/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
- cellects/__main__.py,sha256=qiUkIOuyq3RuyHmYZM3drRbqe5DWP7IVyOGsEy425Lc,1449
3
- cellects/config/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- cellects/config/all_vars_dict.py,sha256=jcmYUeTiVtEkvIbZAYIASP5oCNiM909YQhaRHCY9y-U,6103
5
- cellects/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- cellects/core/cellects_paths.py,sha256=vwFEYXVAD16w0euoTuJ8Ca0tUyelsoiDNmWqryU5k-k,880
7
- cellects/core/cellects_threads.py,sha256=St1bAZTWdsrAYu1DBUyOwWSUJv5sellfaNVF3W14LfQ,88336
8
- cellects/core/motion_analysis.py,sha256=7_fohdeRBFRbJot3g14E6gh58TP9muE4O5fuePqr84A,141997
9
- cellects/core/one_image_analysis.py,sha256=hU9pa0coVA5s_CTiKgn4najlb8J3LQgEIocXCMi_4nM,68583
10
- cellects/core/one_video_per_blob.py,sha256=8YKttLdf0gNO3yASdhvAdo-GEh9btDkXrzku7f-t4h0,35536
11
- cellects/core/program_organizer.py,sha256=gRA3RLdj5i9wPzbqooHd6NoLkPYon5o57HaA7u1d0zQ,77988
12
- cellects/core/script_based_run.py,sha256=Y9FuJ2I5I3_T6vwAQ6w22vdGbkxmjLVAdDWPyoziVGU,6565
13
- cellects/gui/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
- cellects/gui/advanced_parameters.py,sha256=pE2eGZ6tBuq40DalksDzHGGQSjBJcgVr1C2MOAVyGaM,78343
15
- cellects/gui/cellects.py,sha256=qgHLvrAVR1YatSsuOBl5u7aXCUqVHEbhse7EFkTINOA,7574
16
- cellects/gui/custom_widgets.py,sha256=tqOYJqBL_3vcBOYkCuHWVa3MBzcEiQiphEcS0QzLCJA,35563
17
- cellects/gui/first_window.py,sha256=wYQaA-VQFWp_YDjbCXl0e_PgD59-y8kUXRdD2tDelbQ,24803
18
- cellects/gui/if_several_folders_window.py,sha256=ixi6X4WDQ5CtunEPVFJWip8Sf5ba1Hk2t801lX5CNVk,12508
19
- cellects/gui/image_analysis_window.py,sha256=7RX9s-jJkvx6qjnFZE81xKCOnhEeY1LhCIYqVlH5r24,116376
20
- cellects/gui/required_output.py,sha256=YJBSi_Vp5zet2pZVh71viGrlzE8EeMpX41opt3sD8QM,11992
21
- cellects/gui/video_analysis_window.py,sha256=xl2qtJqUp47GvPh7f4tQoaiK8nUO9Q2Rk6qGSiFBLp8,38033
22
- cellects/icons/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
- cellects/icons/cellects_icon.icns,sha256=3GM5rpVKUoy-gAYEee5gGPh9lQx9KZqh9iRqYCT83Aw,393392
24
- cellects/icons/cellects_icon.ico,sha256=Eqlci8zZ0zdsRh2kSQAu4aHAPbR2NEzSbJPgaRQNenI,208076
25
- cellects/image_analysis/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
26
- cellects/image_analysis/cell_leaving_detection.py,sha256=f0wWTACMQASSdXpDtJGe7STJTj6xs1UO1JJzI2FgDBk,2951
27
- cellects/image_analysis/cluster_flux_study.py,sha256=lHKo2OFN_FvmyX9kP7ubRadTVVxuXDeuRWQuydvyAGQ,5496
28
- cellects/image_analysis/image_segmentation.py,sha256=g1UXEfb7UFAv0UzZOxFiMJ0rZb0wrnQ4dC69PSJk_NI,28184
29
- cellects/image_analysis/morphological_operations.py,sha256=a4_SWxk9lik6RZ-DmPrjnkqaV_LUt3h8ar4IQ_F_GTQ,67908
30
- cellects/image_analysis/network_functions.py,sha256=ahxbWWcq7AxXxelaoEALGqdTbWmDWumNWoUALF2MxoU,88545
31
- cellects/image_analysis/one_image_analysis_threads.py,sha256=AjAEbJmtldlf23UxWs5my7xz2NIYy3wm25o13pnnYq8,17253
32
- cellects/image_analysis/progressively_add_distant_shapes.py,sha256=GuTfU57A6JweJHa9dpv7dTVoLX3n2fY6EL9Ul_ukBqU,25799
33
- cellects/image_analysis/shape_descriptors.py,sha256=8E36-A6hdgJLnj0jVj9_flFDCe2-DBCgpvjNNycyF2I,36546
34
- cellects/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
- cellects/utils/decorators.py,sha256=kjZWSK71l5-LrrH7BZHb0kdFaAikC_qZu14_KjIUCms,361
36
- cellects/utils/formulas.py,sha256=Blw_dgYXb3sbxadONvHUUPoC6qlEVC1NJPMnEimNIxo,20397
37
- cellects/utils/load_display_save.py,sha256=a_D9uhXPfne-glgFagc0_C_VqKybR9GY8aebc7uLgyg,38299
38
- cellects/utils/utilitarian.py,sha256=hdCN6PP0z25N-JCElEcGdTzIjyKVG_TYl3BiFmZ2a2k,17248
39
- cellects-0.1.2.dist-info/LICENSE.odt,sha256=tvKfCylOEuclQm5zOnNWBx0Fp4n7M5yqSmTr6SAekbY,37132
40
- cellects-0.1.2.dist-info/METADATA,sha256=gYz_r3dVpqwwYTMKtV_SpMov9bWgFgQy7PyPOZJINlw,3354
41
- cellects-0.1.2.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
42
- cellects-0.1.2.dist-info/entry_points.txt,sha256=JT6rEvKpUuKyDPvfOYma-IMQNvfnKMstFMAoVJhXIGc,60
43
- cellects-0.1.2.dist-info/top_level.txt,sha256=8VlvCH4ka3bqugIpQnOVjc3UV9Vavfx5SXNyUV9_lGw,9
44
- cellects-0.1.2.dist-info/RECORD,,