celldetective 1.2.2.post1__tar.gz → 1.3.0__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 (111) hide show
  1. celldetective-1.3.0/PKG-INFO +217 -0
  2. celldetective-1.3.0/README.md +173 -0
  3. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/__init__.py +1 -0
  4. celldetective-1.3.0/celldetective/__main__.py +40 -0
  5. celldetective-1.3.0/celldetective/_version.py +1 -0
  6. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/events.py +5 -0
  7. celldetective-1.2.2.post1/celldetective/__main__.py → celldetective-1.3.0/celldetective/gui/InitWindow.py +17 -59
  8. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/about.py +2 -1
  9. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/classifier_widget.py +36 -31
  10. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/control_panel.py +33 -23
  11. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/gui_utils.py +9 -3
  12. celldetective-1.3.0/celldetective/gui/help/DL-segmentation-strategy.json +41 -0
  13. celldetective-1.3.0/celldetective/gui/help/Threshold-vs-DL.json +26 -0
  14. celldetective-1.3.0/celldetective/gui/help/cell-populations.json +11 -0
  15. celldetective-1.3.0/celldetective/gui/help/exp-structure.json +36 -0
  16. celldetective-1.3.0/celldetective/gui/help/feature-btrack.json +11 -0
  17. celldetective-1.3.0/celldetective/gui/help/neighborhood.json +16 -0
  18. celldetective-1.3.0/celldetective/gui/help/prefilter-for-segmentation.json +16 -0
  19. celldetective-1.3.0/celldetective/gui/help/preprocessing.json +51 -0
  20. celldetective-1.3.0/celldetective/gui/help/propagate-classification.json +16 -0
  21. celldetective-1.3.0/celldetective/gui/help/track-postprocessing.json +46 -0
  22. celldetective-1.3.0/celldetective/gui/help/tracking.json +11 -0
  23. celldetective-1.3.0/celldetective/gui/measurement_options.py +1001 -0
  24. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/signal_annotator.py +65 -53
  25. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/tableUI.py +196 -26
  26. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/io.py +60 -23
  27. celldetective-1.3.0/celldetective/links/zenodo.json +752 -0
  28. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/measure.py +42 -14
  29. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/segmentation.py +17 -9
  30. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/utils.py +85 -28
  31. celldetective-1.3.0/celldetective.egg-info/PKG-INFO +217 -0
  32. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective.egg-info/SOURCES.txt +14 -0
  33. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective.egg-info/requires.txt +4 -0
  34. {celldetective-1.2.2.post1 → celldetective-1.3.0}/setup.py +14 -3
  35. celldetective-1.3.0/tests/test_qt.py +101 -0
  36. {celldetective-1.2.2.post1 → celldetective-1.3.0}/tests/test_segmentation.py +5 -4
  37. celldetective-1.2.2.post1/PKG-INFO +0 -313
  38. celldetective-1.2.2.post1/README.md +0 -273
  39. celldetective-1.2.2.post1/celldetective/gui/measurement_options.py +0 -1001
  40. celldetective-1.2.2.post1/celldetective/links/zenodo.json +0 -561
  41. celldetective-1.2.2.post1/celldetective.egg-info/PKG-INFO +0 -313
  42. {celldetective-1.2.2.post1 → celldetective-1.3.0}/LICENSE +0 -0
  43. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/datasets/segmentation_annotations/blank +0 -0
  44. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/datasets/signal_annotations/blank +0 -0
  45. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/extra_properties.py +0 -0
  46. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/filters.py +0 -0
  47. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/__init__.py +0 -0
  48. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/analyze_block.py +0 -0
  49. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/btrack_options.py +0 -0
  50. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/configure_new_exp.py +0 -0
  51. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/generic_signal_plot.py +0 -0
  52. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/json_readers.py +0 -0
  53. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/layouts.py +0 -0
  54. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/neighborhood_options.py +0 -0
  55. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/plot_measurements.py +0 -0
  56. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/plot_signals_ui.py +0 -0
  57. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/process_block.py +0 -0
  58. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/retrain_segmentation_model_options.py +0 -0
  59. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/retrain_signal_model_options.py +0 -0
  60. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/seg_model_loader.py +0 -0
  61. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/signal_annotator2.py +0 -0
  62. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/signal_annotator_options.py +0 -0
  63. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/styles.py +0 -0
  64. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/survival_ui.py +0 -0
  65. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/thresholds_gui.py +0 -0
  66. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/gui/viewers.py +0 -0
  67. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/icons/logo-large.png +0 -0
  68. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/icons/logo.png +0 -0
  69. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/icons/signals_icon.png +0 -0
  70. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/icons/splash-test.png +0 -0
  71. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/icons/splash.png +0 -0
  72. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/icons/splash0.png +0 -0
  73. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/icons/survival2.png +0 -0
  74. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/icons/vignette_signals2.png +0 -0
  75. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/icons/vignette_signals2.svg +0 -0
  76. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/models/pair_signal_detection/blank +0 -0
  77. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/models/segmentation_effectors/blank +0 -0
  78. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/models/segmentation_generic/blank +0 -0
  79. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/models/segmentation_targets/blank +0 -0
  80. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/models/signal_detection/blank +0 -0
  81. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/models/tracking_configs/mcf7.json +0 -0
  82. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/models/tracking_configs/ricm.json +0 -0
  83. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/models/tracking_configs/ricm2.json +0 -0
  84. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/neighborhood.py +0 -0
  85. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/preprocessing.py +0 -0
  86. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/relative_measurements.py +0 -0
  87. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/scripts/analyze_signals.py +0 -0
  88. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/scripts/measure_cells.py +0 -0
  89. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/scripts/measure_relative.py +0 -0
  90. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/scripts/segment_cells.py +0 -0
  91. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/scripts/segment_cells_thresholds.py +0 -0
  92. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/scripts/track_cells.py +0 -0
  93. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/scripts/train_segmentation_model.py +0 -0
  94. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/scripts/train_signal_model.py +0 -0
  95. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/signals.py +0 -0
  96. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective/tracking.py +0 -0
  97. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective.egg-info/dependency_links.txt +0 -0
  98. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective.egg-info/entry_points.txt +0 -0
  99. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective.egg-info/not-zip-safe +0 -0
  100. {celldetective-1.2.2.post1 → celldetective-1.3.0}/celldetective.egg-info/top_level.txt +0 -0
  101. {celldetective-1.2.2.post1 → celldetective-1.3.0}/setup.cfg +0 -0
  102. {celldetective-1.2.2.post1 → celldetective-1.3.0}/tests/__init__.py +0 -0
  103. {celldetective-1.2.2.post1 → celldetective-1.3.0}/tests/test_events.py +0 -0
  104. {celldetective-1.2.2.post1 → celldetective-1.3.0}/tests/test_filters.py +0 -0
  105. {celldetective-1.2.2.post1 → celldetective-1.3.0}/tests/test_io.py +0 -0
  106. {celldetective-1.2.2.post1 → celldetective-1.3.0}/tests/test_measure.py +0 -0
  107. {celldetective-1.2.2.post1 → celldetective-1.3.0}/tests/test_neighborhood.py +0 -0
  108. {celldetective-1.2.2.post1 → celldetective-1.3.0}/tests/test_preprocessing.py +0 -0
  109. {celldetective-1.2.2.post1 → celldetective-1.3.0}/tests/test_signals.py +0 -0
  110. {celldetective-1.2.2.post1 → celldetective-1.3.0}/tests/test_tracking.py +0 -0
  111. {celldetective-1.2.2.post1 → celldetective-1.3.0}/tests/test_utils.py +0 -0
@@ -0,0 +1,217 @@
1
+ Metadata-Version: 2.1
2
+ Name: celldetective
3
+ Version: 1.3.0
4
+ Summary: description
5
+ Home-page: http://github.com/remyeltorro/celldetective
6
+ Author: Rémy Torro
7
+ Author-email: remy.torro@inserm.fr
8
+ License: GPL-3.0
9
+ Description-Content-Type: text/markdown
10
+ License-File: LICENSE
11
+ Requires-Dist: wheel
12
+ Requires-Dist: nbsphinx
13
+ Requires-Dist: nbsphinx_link
14
+ Requires-Dist: sphinx_rtd_theme
15
+ Requires-Dist: sphinx
16
+ Requires-Dist: jinja2
17
+ Requires-Dist: ipykernel
18
+ Requires-Dist: stardist
19
+ Requires-Dist: cellpose<3
20
+ Requires-Dist: scikit-learn
21
+ Requires-Dist: btrack
22
+ Requires-Dist: tensorflow~=2.15.0
23
+ Requires-Dist: napari
24
+ Requires-Dist: tqdm
25
+ Requires-Dist: mahotas
26
+ Requires-Dist: fonticon-materialdesignicons6
27
+ Requires-Dist: art
28
+ Requires-Dist: lifelines
29
+ Requires-Dist: setuptools
30
+ Requires-Dist: scipy
31
+ Requires-Dist: seaborn
32
+ Requires-Dist: opencv-python-headless==4.7.0.72
33
+ Requires-Dist: liblapack
34
+ Requires-Dist: gputools
35
+ Requires-Dist: lmfit
36
+ Requires-Dist: superqt[cmap]
37
+ Requires-Dist: setuptools
38
+ Requires-Dist: matplotlib_scalebar
39
+ Requires-Dist: numpy==1.26.4
40
+ Requires-Dist: pytest
41
+ Requires-Dist: pytest-qt
42
+ Requires-Dist: h5py
43
+ Requires-Dist: cliffs_delta
44
+
45
+ # Celldetective
46
+
47
+ <embed>
48
+ <p align="center">
49
+ <img src="https://github.com/remyeltorro/celldetective/blob/main/celldetective/icons/logo-large.png" width="33%" />
50
+ </p>
51
+ </embed>
52
+
53
+ ![ico1](https://img.shields.io/readthedocs/celldetective?link=https%3A%2F%2Fcelldetective.readthedocs.io%2Fen%2Flatest%2Findex.html)
54
+ ![ico17](https://github.com/remyeltorro/celldetective/actions/workflows/test.yml/badge.svg)
55
+ ![ico4](https://img.shields.io/pypi/v/celldetective)
56
+ ![ico6](https://img.shields.io/github/downloads/remyeltorro/celldetective/total)
57
+ ![ico5](https://img.shields.io/pypi/dm/celldetective)
58
+ ![GitHub repo size](https://img.shields.io/github/repo-size/remyeltorro/celldetective)
59
+ ![GitHub License](https://img.shields.io/github/license/remyeltorro/celldetective?link=https%3A%2F%2Fgithub.com%2Fremyeltorro%2Fcelldetective%2Fblob%2Fmain%2FLICENSE)
60
+ ![ico2](https://img.shields.io/github/forks/remyeltorro/celldetective?link=https%3A%2F%2Fgithub.com%2Fremyeltorro%2Fcelldetective%2Fforks)
61
+ ![ico3](https://img.shields.io/github/stars/remyeltorro/celldetective?link=https%3A%2F%2Fgithub.com%2Fremyeltorro%2Fcelldetective%2Fstargazers)
62
+
63
+ Celldetective is a python package and graphical user interface to perform single-cell
64
+ analysis on multimodal time lapse microscopy images.
65
+
66
+ - [Check the full documentation](https://celldetective.readthedocs.io)
67
+ - [Report a bug or request a new feature](https://github.com/remyeltorro/celldetective/issues/new/choose)
68
+ - [Explore the datasets, models and demos](https://zenodo.org/records/10650279)
69
+
70
+ ## Overview
71
+
72
+ ![Pipeline](https://github.com/remyeltorro/celldetective/raw/main/docs/source/_static/celldetective-blocks.png)
73
+
74
+
75
+ Celldetective was designed to analyze time-lapse microscopy images in difficult situations: mixed cell populations that are only separable through multimodal information. This software provides a toolkit for the analysis of cell population interactions.
76
+
77
+
78
+ **Key features**:
79
+ - Achieve single-cell description (segment / track / measure) for up to two populations of interest
80
+ - Signal annotation and traditional or Deep learning automation
81
+ - Mask annotation in napari[^5] and retraining of Deep learning models
82
+ - Neighborhood linking within and across populations and interaction annotations
83
+ - Everything is done graphically, no coding is required!
84
+
85
+ Check out the [highlights](https://celldetective.readthedocs.io/en/latest/overview.html#description) in the documentation!
86
+
87
+ Instead of reinventing the wheel and out of respect for the amazing work done by these teams, we chose to build around StarDist[^1] & Cellpose[^2][^3] (BSD-3 license) for the Deep-learning segmentation and the Bayesian tracker bTrack[^4] (MIT license) for tracking. If you use these models or methods in your Celldetective workflow, don't forget to cite the respective papers!
88
+
89
+ **Target Audience**: The software is targeted to scientists who are interested in quantifying dynamically (or not) cell populations from microscopy images. Experimental scientists who produce such images can also analyze their data, thanks to the graphical interface, that completely removes the need for coding, and the many helper functions that guide the user in the analysis steps. Finally, the modular structure of Celldetective welcomes users with a partial need.
90
+
91
+ ![Signal analysis](https://github.com/remyeltorro/celldetective/raw/main/docs/source/_static/signal-annotator.gif)
92
+
93
+
94
+ # System requirements
95
+
96
+ ## Hardware requirements
97
+
98
+ The software was tested on several machines, including:
99
+
100
+ - An Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz, with a single NVIDIA
101
+ GeForce RTX 3070 (8 Gb of memory) and 16 Gb of memory
102
+ - An Intel(R) Core(TM) i7-9750H CPU @ 2.60 GHz, with 16 Gb of memory
103
+
104
+ In GPU mode, succesive segmentation and DL signal analysis could be
105
+ performed without saturating the GPU memory thanks to the subprocess
106
+ formulation for the different modules. The GPU can be disabled in the
107
+ startup window. The software does not require a GPU (but model inference
108
+ will be longer).
109
+
110
+ A typical analysis of a single movie with a GPU takes
111
+ between 3 to 15 minutes. Depending on the number of cells and frames on
112
+ the images, this computation time can increase to the order of half an
113
+ hour on a CPU.
114
+
115
+ Processing is performed frame by frame, therefore the memory requirement is extremely low. The main bottleneck is in the visualization of segmentation and tracking output. Whole stacks (typically 1-9 Gb) have to be loaded in memory at once to be viewed in napari.
116
+
117
+ ## Software requirements
118
+
119
+ The software was developed simulateously on Ubuntu 20.04 and Windows 11.
120
+ It was tested on MacOS, but Tensorflow installation can require extra
121
+ steps.
122
+
123
+ - Linux: Ubuntu 20.04.6 LTS (Focal Fossa)
124
+ - Windows: Windows 11 Home 23H2
125
+
126
+ To use the software, you must install python, *e.g.* through
127
+ [Anaconda](https://www.anaconda.com/download). Celldetective is routinely tested on both Ubuntu and Windows for Python versions 3.9, 3.10 and 3.11.
128
+
129
+ # Installation
130
+
131
+ ## Stable release
132
+
133
+ Celldetective requires a version of Python between 3.9 and 3.11 (included). If your Python version is older or more recent, consider using `conda` to create an environment as described below.
134
+
135
+ With the proper Python version, Celldetective can be directly installed with `pip`:
136
+
137
+ ``` bash
138
+ pip install celldetective
139
+ ```
140
+
141
+ We recommend that you create an environment to use Celldetective, to protect your package versions and fix the Python version *e.g.*
142
+ with `conda`:
143
+
144
+ ``` bash
145
+ conda create -n celldetective python=3.11 pyqt
146
+ conda activate celldetective
147
+ pip install celldetective
148
+ ```
149
+
150
+ Need an update? Simply type the following in the terminal (in your
151
+ environment):
152
+
153
+ ``` bash
154
+ pip install --upgrade celldetective
155
+ ```
156
+
157
+ For more installation options, please check the [documentation](https://celldetective.readthedocs.io/en/latest/get-started.html#installation).
158
+
159
+
160
+ # Quick start
161
+
162
+ You can launch the GUI by 1) opening a terminal and 2) typing the
163
+ following:
164
+
165
+ ``` bash
166
+ # conda activate celldetective
167
+ python -m celldetective
168
+ ```
169
+
170
+ For more information about how to get started, please check the [documentation](https://celldetective.readthedocs.io/en/latest/get-started.html#launching-the-gui).
171
+
172
+ # How to cite?
173
+
174
+ If you use this software in your research, please cite the
175
+ [Celldetective](https://www.biorxiv.org/content/10.1101/2024.03.15.585250v1)
176
+ paper (currently preprint):
177
+
178
+ ``` raw
179
+ @article {Torro2024.03.15.585250,
180
+ author = {R{\'e}my Torro and Beatriz D{\`\i}az-Bello and Dalia El Arawi and Lorna Ammer and Patrick Chames and Kheya Sengupta and Laurent Limozin},
181
+ title = {Celldetective: an AI-enhanced image analysis tool for unraveling dynamic cell interactions},
182
+ elocation-id = {2024.03.15.585250},
183
+ year = {2024},
184
+ doi = {10.1101/2024.03.15.585250},
185
+ publisher = {Cold Spring Harbor Laboratory},
186
+ abstract = {A current key challenge in bioimaging is the analysis of multimodal and multidimensional data reporting dynamic interactions between diverse cell populations. We developed Celldetective, a software that integrates AI-based segmentation and tracking algorithms and automated signal analysis into a user-friendly graphical interface. It offers complete interactive visualization, annotation, and training capabilities. We demonstrate it by analyzing original experimental data of spreading immune effector cells as well as antibody-dependent cell cytotoxicity events using multimodal fluorescence microscopy.Competing Interest StatementThe authors have declared no competing interest.},
187
+ URL = {https://www.biorxiv.org/content/early/2024/03/17/2024.03.15.585250},
188
+ eprint = {https://www.biorxiv.org/content/early/2024/03/17/2024.03.15.585250.full.pdf},
189
+ journal = {bioRxiv}
190
+ }
191
+ ```
192
+
193
+ Make sure you to cite the papers of any segmentation model (StarDist,
194
+ Cellpose) or tracker (bTrack) you used through Celldetective.
195
+
196
+ # Bibliography
197
+
198
+ [^1]: Schmidt, U., Weigert, M., Broaddus, C. & Myers, G. Cell Detection
199
+ with Star-Convex Polygons. in Medical Image Computing and Computer
200
+ Assisted Intervention -- MICCAI 2018 (eds. Frangi, A. F., Schnabel,
201
+ J. A., Davatzikos, C., Alberola-López, C. & Fichtinger, G.) 265--273
202
+ (Springer International Publishing, Cham, 2018).
203
+ <doi:10.1007/978-3-030-00934-2_30>.
204
+
205
+ [^2]: Stringer, C., Wang, T., Michaelos, M. & Pachitariu, M. Cellpose: a
206
+ generalist algorithm for cellular segmentation. Nat Methods 18,
207
+ 100--106 (2021).
208
+
209
+ [^3]: Pachitariu, M. & Stringer, C. Cellpose 2.0: how to train your own
210
+ model. Nat Methods 19, 1634--1641 (2022).
211
+
212
+ [^4]: Ulicna, K., Vallardi, G., Charras, G. & Lowe, A. R. Automated Deep
213
+ Lineage Tree Analysis Using a Bayesian Single Cell Tracking
214
+ Approach. Frontiers in Computer Science 3, (2021).
215
+
216
+ [^5]: Ahlers, J. et al. napari: a multi-dimensional image viewer for
217
+ Python. Zenodo <https://doi.org/10.5281/zenodo.8115575> (2023).
@@ -0,0 +1,173 @@
1
+ # Celldetective
2
+
3
+ <embed>
4
+ <p align="center">
5
+ <img src="https://github.com/remyeltorro/celldetective/blob/main/celldetective/icons/logo-large.png" width="33%" />
6
+ </p>
7
+ </embed>
8
+
9
+ ![ico1](https://img.shields.io/readthedocs/celldetective?link=https%3A%2F%2Fcelldetective.readthedocs.io%2Fen%2Flatest%2Findex.html)
10
+ ![ico17](https://github.com/remyeltorro/celldetective/actions/workflows/test.yml/badge.svg)
11
+ ![ico4](https://img.shields.io/pypi/v/celldetective)
12
+ ![ico6](https://img.shields.io/github/downloads/remyeltorro/celldetective/total)
13
+ ![ico5](https://img.shields.io/pypi/dm/celldetective)
14
+ ![GitHub repo size](https://img.shields.io/github/repo-size/remyeltorro/celldetective)
15
+ ![GitHub License](https://img.shields.io/github/license/remyeltorro/celldetective?link=https%3A%2F%2Fgithub.com%2Fremyeltorro%2Fcelldetective%2Fblob%2Fmain%2FLICENSE)
16
+ ![ico2](https://img.shields.io/github/forks/remyeltorro/celldetective?link=https%3A%2F%2Fgithub.com%2Fremyeltorro%2Fcelldetective%2Fforks)
17
+ ![ico3](https://img.shields.io/github/stars/remyeltorro/celldetective?link=https%3A%2F%2Fgithub.com%2Fremyeltorro%2Fcelldetective%2Fstargazers)
18
+
19
+ Celldetective is a python package and graphical user interface to perform single-cell
20
+ analysis on multimodal time lapse microscopy images.
21
+
22
+ - [Check the full documentation](https://celldetective.readthedocs.io)
23
+ - [Report a bug or request a new feature](https://github.com/remyeltorro/celldetective/issues/new/choose)
24
+ - [Explore the datasets, models and demos](https://zenodo.org/records/10650279)
25
+
26
+ ## Overview
27
+
28
+ ![Pipeline](https://github.com/remyeltorro/celldetective/raw/main/docs/source/_static/celldetective-blocks.png)
29
+
30
+
31
+ Celldetective was designed to analyze time-lapse microscopy images in difficult situations: mixed cell populations that are only separable through multimodal information. This software provides a toolkit for the analysis of cell population interactions.
32
+
33
+
34
+ **Key features**:
35
+ - Achieve single-cell description (segment / track / measure) for up to two populations of interest
36
+ - Signal annotation and traditional or Deep learning automation
37
+ - Mask annotation in napari[^5] and retraining of Deep learning models
38
+ - Neighborhood linking within and across populations and interaction annotations
39
+ - Everything is done graphically, no coding is required!
40
+
41
+ Check out the [highlights](https://celldetective.readthedocs.io/en/latest/overview.html#description) in the documentation!
42
+
43
+ Instead of reinventing the wheel and out of respect for the amazing work done by these teams, we chose to build around StarDist[^1] & Cellpose[^2][^3] (BSD-3 license) for the Deep-learning segmentation and the Bayesian tracker bTrack[^4] (MIT license) for tracking. If you use these models or methods in your Celldetective workflow, don't forget to cite the respective papers!
44
+
45
+ **Target Audience**: The software is targeted to scientists who are interested in quantifying dynamically (or not) cell populations from microscopy images. Experimental scientists who produce such images can also analyze their data, thanks to the graphical interface, that completely removes the need for coding, and the many helper functions that guide the user in the analysis steps. Finally, the modular structure of Celldetective welcomes users with a partial need.
46
+
47
+ ![Signal analysis](https://github.com/remyeltorro/celldetective/raw/main/docs/source/_static/signal-annotator.gif)
48
+
49
+
50
+ # System requirements
51
+
52
+ ## Hardware requirements
53
+
54
+ The software was tested on several machines, including:
55
+
56
+ - An Intel(R) Core(TM) i9-10850K CPU @ 3.60GHz, with a single NVIDIA
57
+ GeForce RTX 3070 (8 Gb of memory) and 16 Gb of memory
58
+ - An Intel(R) Core(TM) i7-9750H CPU @ 2.60 GHz, with 16 Gb of memory
59
+
60
+ In GPU mode, succesive segmentation and DL signal analysis could be
61
+ performed without saturating the GPU memory thanks to the subprocess
62
+ formulation for the different modules. The GPU can be disabled in the
63
+ startup window. The software does not require a GPU (but model inference
64
+ will be longer).
65
+
66
+ A typical analysis of a single movie with a GPU takes
67
+ between 3 to 15 minutes. Depending on the number of cells and frames on
68
+ the images, this computation time can increase to the order of half an
69
+ hour on a CPU.
70
+
71
+ Processing is performed frame by frame, therefore the memory requirement is extremely low. The main bottleneck is in the visualization of segmentation and tracking output. Whole stacks (typically 1-9 Gb) have to be loaded in memory at once to be viewed in napari.
72
+
73
+ ## Software requirements
74
+
75
+ The software was developed simulateously on Ubuntu 20.04 and Windows 11.
76
+ It was tested on MacOS, but Tensorflow installation can require extra
77
+ steps.
78
+
79
+ - Linux: Ubuntu 20.04.6 LTS (Focal Fossa)
80
+ - Windows: Windows 11 Home 23H2
81
+
82
+ To use the software, you must install python, *e.g.* through
83
+ [Anaconda](https://www.anaconda.com/download). Celldetective is routinely tested on both Ubuntu and Windows for Python versions 3.9, 3.10 and 3.11.
84
+
85
+ # Installation
86
+
87
+ ## Stable release
88
+
89
+ Celldetective requires a version of Python between 3.9 and 3.11 (included). If your Python version is older or more recent, consider using `conda` to create an environment as described below.
90
+
91
+ With the proper Python version, Celldetective can be directly installed with `pip`:
92
+
93
+ ``` bash
94
+ pip install celldetective
95
+ ```
96
+
97
+ We recommend that you create an environment to use Celldetective, to protect your package versions and fix the Python version *e.g.*
98
+ with `conda`:
99
+
100
+ ``` bash
101
+ conda create -n celldetective python=3.11 pyqt
102
+ conda activate celldetective
103
+ pip install celldetective
104
+ ```
105
+
106
+ Need an update? Simply type the following in the terminal (in your
107
+ environment):
108
+
109
+ ``` bash
110
+ pip install --upgrade celldetective
111
+ ```
112
+
113
+ For more installation options, please check the [documentation](https://celldetective.readthedocs.io/en/latest/get-started.html#installation).
114
+
115
+
116
+ # Quick start
117
+
118
+ You can launch the GUI by 1) opening a terminal and 2) typing the
119
+ following:
120
+
121
+ ``` bash
122
+ # conda activate celldetective
123
+ python -m celldetective
124
+ ```
125
+
126
+ For more information about how to get started, please check the [documentation](https://celldetective.readthedocs.io/en/latest/get-started.html#launching-the-gui).
127
+
128
+ # How to cite?
129
+
130
+ If you use this software in your research, please cite the
131
+ [Celldetective](https://www.biorxiv.org/content/10.1101/2024.03.15.585250v1)
132
+ paper (currently preprint):
133
+
134
+ ``` raw
135
+ @article {Torro2024.03.15.585250,
136
+ author = {R{\'e}my Torro and Beatriz D{\`\i}az-Bello and Dalia El Arawi and Lorna Ammer and Patrick Chames and Kheya Sengupta and Laurent Limozin},
137
+ title = {Celldetective: an AI-enhanced image analysis tool for unraveling dynamic cell interactions},
138
+ elocation-id = {2024.03.15.585250},
139
+ year = {2024},
140
+ doi = {10.1101/2024.03.15.585250},
141
+ publisher = {Cold Spring Harbor Laboratory},
142
+ abstract = {A current key challenge in bioimaging is the analysis of multimodal and multidimensional data reporting dynamic interactions between diverse cell populations. We developed Celldetective, a software that integrates AI-based segmentation and tracking algorithms and automated signal analysis into a user-friendly graphical interface. It offers complete interactive visualization, annotation, and training capabilities. We demonstrate it by analyzing original experimental data of spreading immune effector cells as well as antibody-dependent cell cytotoxicity events using multimodal fluorescence microscopy.Competing Interest StatementThe authors have declared no competing interest.},
143
+ URL = {https://www.biorxiv.org/content/early/2024/03/17/2024.03.15.585250},
144
+ eprint = {https://www.biorxiv.org/content/early/2024/03/17/2024.03.15.585250.full.pdf},
145
+ journal = {bioRxiv}
146
+ }
147
+ ```
148
+
149
+ Make sure you to cite the papers of any segmentation model (StarDist,
150
+ Cellpose) or tracker (bTrack) you used through Celldetective.
151
+
152
+ # Bibliography
153
+
154
+ [^1]: Schmidt, U., Weigert, M., Broaddus, C. & Myers, G. Cell Detection
155
+ with Star-Convex Polygons. in Medical Image Computing and Computer
156
+ Assisted Intervention -- MICCAI 2018 (eds. Frangi, A. F., Schnabel,
157
+ J. A., Davatzikos, C., Alberola-López, C. & Fichtinger, G.) 265--273
158
+ (Springer International Publishing, Cham, 2018).
159
+ <doi:10.1007/978-3-030-00934-2_30>.
160
+
161
+ [^2]: Stringer, C., Wang, T., Michaelos, M. & Pachitariu, M. Cellpose: a
162
+ generalist algorithm for cellular segmentation. Nat Methods 18,
163
+ 100--106 (2021).
164
+
165
+ [^3]: Pachitariu, M. & Stringer, C. Cellpose 2.0: how to train your own
166
+ model. Nat Methods 19, 1634--1641 (2022).
167
+
168
+ [^4]: Ulicna, K., Vallardi, G., Charras, G. & Lowe, A. R. Automated Deep
169
+ Lineage Tree Analysis Using a Bayesian Single Cell Tracking
170
+ Approach. Frontiers in Computer Science 3, (2021).
171
+
172
+ [^5]: Ahlers, J. et al. napari: a multi-dimensional image viewer for
173
+ Python. Zenodo <https://doi.org/10.5281/zenodo.8115575> (2023).
@@ -1,3 +1,4 @@
1
+ from ._version import __version__
1
2
  #from .tracking import track, clean_trajectories
2
3
  #from .measure import contour_of_instance_segmentation
3
4
 
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env python3
2
+ import sys
3
+ from PyQt5.QtWidgets import QApplication, QSplashScreen
4
+ from PyQt5.QtGui import QPixmap
5
+ from os import sep
6
+ from celldetective.utils import get_software_location
7
+ from time import time, sleep
8
+ #os.environ['QT_DEBUG_PLUGINS'] = '1'
9
+
10
+ if __name__ == "__main__":
11
+
12
+ splash=True
13
+ print('Loading the libraries...')
14
+
15
+ App = QApplication(sys.argv)
16
+ App.setStyle("Fusion")
17
+
18
+ if splash:
19
+ start = time()
20
+ splash_pix = QPixmap(sep.join([get_software_location(),'celldetective','icons','splash.png']))
21
+ splash = QSplashScreen(splash_pix)
22
+ splash.setMask(splash_pix.mask())
23
+ splash.show()
24
+ #App.processEvents(QEventLoop.AllEvents, 300)
25
+ while time() - start < 1:
26
+ sleep(0.001)
27
+ App.processEvents()
28
+
29
+ from PyQt5.QtWidgets import QFileDialog, QWidget, QVBoxLayout, QCheckBox, QHBoxLayout, QLabel, QLineEdit, QPushButton, QMessageBox, QMenu, QAction
30
+ from PyQt5.QtGui import QIcon, QDesktopServices, QIntValidator
31
+ from celldetective.gui.InitWindow import AppInitWindow
32
+
33
+ print('Libraries successfully loaded...')
34
+
35
+ window = AppInitWindow(App)
36
+
37
+ if splash:
38
+ splash.finish(window)
39
+
40
+ sys.exit(App.exec())
@@ -0,0 +1 @@
1
+ __version__ = "1.3.0"
@@ -117,6 +117,11 @@ def compute_survival(df, class_of_interest, t_event, t_reference=None, FrameToMi
117
117
  event_times = df.groupby(['position','TRACK_ID'])[t_event].min().values
118
118
  max_times = df.groupby(['position','TRACK_ID'])['FRAME'].max().values
119
119
 
120
+ if t_reference=="0" or t_reference==0:
121
+ t_reference = None
122
+ left_censored = False
123
+ first_detections = None
124
+
120
125
  if t_reference is not None:
121
126
  left_censored = True
122
127
  assert t_reference in cols,"The reference time cannot be found in the dataframe..."
@@ -1,13 +1,22 @@
1
- #!/usr/bin/env python3
2
- import sys
3
- from PyQt5.QtWidgets import QApplication, QSplashScreen, QMainWindow
4
- from PyQt5.QtGui import QPixmap
5
- from os import sep
1
+ from PyQt5.QtWidgets import QApplication, QMainWindow
6
2
  from celldetective.utils import get_software_location
7
- #from PyQt5.QtCore import QEventLoop
8
- from time import time, sleep
9
3
  import os
10
- #os.environ['QT_DEBUG_PLUGINS'] = '1'
4
+ from PyQt5.QtWidgets import QFileDialog, QWidget, QVBoxLayout, QCheckBox, QHBoxLayout, QLabel, QLineEdit, QPushButton, QMessageBox, QMenu, QAction
5
+ from PyQt5.QtCore import Qt, QUrl
6
+ from PyQt5.QtGui import QIcon, QDesktopServices, QIntValidator
7
+ from glob import glob
8
+ from superqt.fonticon import icon
9
+ from fonticon_mdi6 import MDI6
10
+ import gc
11
+ from celldetective.gui import Styles, ControlPanel, ConfigNewExperiment
12
+ from celldetective.gui.gui_utils import center_window
13
+ import subprocess
14
+ import os
15
+ from celldetective.gui.about import AboutWidget
16
+ from celldetective.io import correct_annotation
17
+ import psutil
18
+ import subprocess
19
+ import json
11
20
 
12
21
  class AppInitWindow(QMainWindow):
13
22
 
@@ -389,54 +398,3 @@ class AppInitWindow(QMainWindow):
389
398
  if returnValue == QMessageBox.Ok:
390
399
  self.experiment_path_selection.setText('')
391
400
  return None
392
-
393
- if __name__ == "__main__":
394
-
395
- # import ctypes
396
- # myappid = 'mycompany.myproduct.subproduct.version' # arbitrary string
397
- # ctypes.windll.shell32.SetCurrentProcessExplicitAppUserModelID(myappid)
398
- splash=True
399
- print('Loading the libraries...')
400
-
401
- App = QApplication(sys.argv)
402
- #App.setWindowIcon(QIcon(os.sep.join([get_software_location(),'celldetective','icons','mexican-hat.png'])))
403
- App.setStyle("Fusion")
404
-
405
- if splash:
406
- start = time()
407
- splash_pix = QPixmap(sep.join([get_software_location(),'celldetective','icons','splash.png']))
408
- splash = QSplashScreen(splash_pix)
409
- splash.setMask(splash_pix.mask())
410
- splash.show()
411
- #App.processEvents(QEventLoop.AllEvents, 300)
412
- while time() - start < 1:
413
- sleep(0.001)
414
- App.processEvents()
415
-
416
- from PyQt5.QtWidgets import QFileDialog, QWidget, QVBoxLayout, QCheckBox, QHBoxLayout, QLabel, QLineEdit, QPushButton, QMessageBox, QMenu, QAction
417
- from PyQt5.QtCore import Qt, QUrl
418
- from PyQt5.QtGui import QIcon, QDesktopServices, QIntValidator
419
- from glob import glob
420
- from superqt.fonticon import icon
421
- from fonticon_mdi6 import MDI6
422
- import gc
423
- from celldetective.gui import Styles, ControlPanel, ConfigNewExperiment
424
- from celldetective.gui.gui_utils import center_window
425
- import subprocess
426
- import os
427
- from celldetective.gui.about import AboutWidget
428
- from celldetective.io import correct_annotation
429
- import psutil
430
- import subprocess
431
- import json
432
- # import matplotlib
433
- # matplotlib.rcParams.update({'font.size': 8})
434
-
435
- print('Libraries successfully loaded...')
436
-
437
- window = AppInitWindow(App)
438
-
439
- if splash:
440
- splash.finish(window)
441
-
442
- sys.exit(App.exec())
@@ -4,6 +4,7 @@ from PyQt5.QtCore import Qt
4
4
  from celldetective.utils import get_software_location
5
5
  import os
6
6
  from celldetective.gui.gui_utils import center_window
7
+ from celldetective._version import __version__
7
8
 
8
9
  class AboutWidget(QWidget):
9
10
 
@@ -27,7 +28,7 @@ class AboutWidget(QWidget):
27
28
  """)
28
29
  layout.addWidget(self.soft_name, alignment=Qt.AlignCenter)
29
30
 
30
- self.version_lbl = QLabel(f"Version X.X.X <a href=\"https://github.com/remyeltorro/celldetective/releases\">(release notes)</a>")
31
+ self.version_lbl = QLabel(f"Version {__version__} <a href=\"https://github.com/remyeltorro/celldetective/releases\">(release notes)</a>")
31
32
  self.version_lbl.setOpenExternalLinks(True)
32
33
  layout.addWidget(self.version_lbl, alignment=Qt.AlignCenter)
33
34
 
@@ -10,7 +10,7 @@ import numpy as np
10
10
  import matplotlib.pyplot as plt
11
11
  import json
12
12
 
13
- from celldetective.gui.gui_utils import FigureCanvas, center_window, color_from_status, help_generic
13
+ from celldetective.gui.gui_utils import FigureCanvas, center_window, color_from_status, help_generic, color_from_class
14
14
  from celldetective.gui import Styles
15
15
  from celldetective.utils import get_software_location
16
16
  from celldetective.measure import classify_cells_from_query, interpret_track_classification
@@ -242,37 +242,42 @@ class ClassifierWidget(QWidget, Styles):
242
242
 
243
243
  def update_props_scatter(self, feature_changed=True):
244
244
 
245
- if not self.project_times:
246
- self.scat_props.set_offsets(self.df.loc[self.df['FRAME']==self.currentFrame,[self.features_cb[1].currentText(),self.features_cb[0].currentText()]].to_numpy())
247
- colors = [color_from_status(c) for c in self.df.loc[self.df['FRAME']==self.currentFrame,self.class_name].to_numpy()]
248
- self.scat_props.set_facecolor(colors)
249
- self.scat_props.set_alpha(self.currentAlpha)
250
- self.ax_props.set_xlabel(self.features_cb[1].currentText())
251
- self.ax_props.set_ylabel(self.features_cb[0].currentText())
252
- else:
253
- self.scat_props.set_offsets(self.df[[self.features_cb[1].currentText(),self.features_cb[0].currentText()]].to_numpy())
254
- colors = [color_from_class(c) for c in self.df[self.class_name].to_numpy()]
255
- self.scat_props.set_facecolor(colors)
256
- self.scat_props.set_alpha(self.currentAlpha)
257
- self.ax_props.set_xlabel(self.features_cb[1].currentText())
258
- self.ax_props.set_ylabel(self.features_cb[0].currentText())
259
-
260
-
261
- feat_x = self.features_cb[1].currentText()
262
- feat_y = self.features_cb[0].currentText()
263
- min_x = self.df.dropna(subset=feat_x)[feat_x].min()
264
- max_x = self.df.dropna(subset=feat_x)[feat_x].max()
265
- min_y = self.df.dropna(subset=feat_y)[feat_y].min()
266
- max_y = self.df.dropna(subset=feat_y)[feat_y].max()
267
-
268
- if min_x==min_x and max_x==max_x:
269
- self.ax_props.set_xlim(min_x, max_x)
270
- if min_y==min_y and max_y==max_y:
271
- self.ax_props.set_ylim(min_y, max_y)
245
+ try:
246
+
247
+ if not self.project_times:
248
+ self.scat_props.set_offsets(self.df.loc[self.df['FRAME']==self.currentFrame,[self.features_cb[1].currentText(),self.features_cb[0].currentText()]].to_numpy())
249
+ colors = [color_from_status(c) for c in self.df.loc[self.df['FRAME']==self.currentFrame,self.class_name].to_numpy()]
250
+ self.scat_props.set_facecolor(colors)
251
+ self.scat_props.set_alpha(self.currentAlpha)
252
+ self.ax_props.set_xlabel(self.features_cb[1].currentText())
253
+ self.ax_props.set_ylabel(self.features_cb[0].currentText())
254
+ else:
255
+ self.scat_props.set_offsets(self.df[[self.features_cb[1].currentText(),self.features_cb[0].currentText()]].to_numpy())
256
+ colors = [color_from_status(c) for c in self.df[self.class_name].to_numpy()]
257
+ self.scat_props.set_facecolor(colors)
258
+ self.scat_props.set_alpha(self.currentAlpha)
259
+ self.ax_props.set_xlabel(self.features_cb[1].currentText())
260
+ self.ax_props.set_ylabel(self.features_cb[0].currentText())
261
+
262
+
263
+ feat_x = self.features_cb[1].currentText()
264
+ feat_y = self.features_cb[0].currentText()
265
+ min_x = self.df.dropna(subset=feat_x)[feat_x].min()
266
+ max_x = self.df.dropna(subset=feat_x)[feat_x].max()
267
+ min_y = self.df.dropna(subset=feat_y)[feat_y].min()
268
+ max_y = self.df.dropna(subset=feat_y)[feat_y].max()
269
+
270
+ if min_x==min_x and max_x==max_x:
271
+ self.ax_props.set_xlim(min_x, max_x)
272
+ if min_y==min_y and max_y==max_y:
273
+ self.ax_props.set_ylim(min_y, max_y)
274
+
275
+ if feature_changed:
276
+ self.propscanvas.canvas.toolbar.update()
277
+ self.propscanvas.canvas.draw_idle()
272
278
 
273
- if feature_changed:
274
- self.propscanvas.canvas.toolbar.update()
275
- self.propscanvas.canvas.draw_idle()
279
+ except Exception as e:
280
+ pass
276
281
 
277
282
  def apply_property_query(self):
278
283