tapenade 0.0.1__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 (36) hide show
  1. tapenade-0.0.1/LICENSE +22 -0
  2. tapenade-0.0.1/MANIFEST.in +5 -0
  3. tapenade-0.0.1/PKG-INFO +213 -0
  4. tapenade-0.0.1/README.md +165 -0
  5. tapenade-0.0.1/pyproject.toml +77 -0
  6. tapenade-0.0.1/setup.cfg +74 -0
  7. tapenade-0.0.1/src/tapenade/__init__.py +1 -0
  8. tapenade-0.0.1/src/tapenade/_tests/__init__.py +0 -0
  9. tapenade-0.0.1/src/tapenade/analysis/__init__.py +0 -0
  10. tapenade-0.0.1/src/tapenade/analysis/deformation/__init__.py +22 -0
  11. tapenade-0.0.1/src/tapenade/analysis/deformation/additional_regionprops_properties.py +284 -0
  12. tapenade-0.0.1/src/tapenade/analysis/deformation/deformation_quantification.py +76 -0
  13. tapenade-0.0.1/src/tapenade/analysis/spatial_correlation/__init__.py +3 -0
  14. tapenade-0.0.1/src/tapenade/analysis/spatial_correlation/_spatial_correlation_plotter.py +415 -0
  15. tapenade-0.0.1/src/tapenade/preprocessing/__init__.py +23 -0
  16. tapenade-0.0.1/src/tapenade/preprocessing/_array_rescaling.py +50 -0
  17. tapenade-0.0.1/src/tapenade/preprocessing/_axis_alignment.py +94 -0
  18. tapenade-0.0.1/src/tapenade/preprocessing/_intensity_normalization.py +129 -0
  19. tapenade-0.0.1/src/tapenade/preprocessing/_labels_masking.py +35 -0
  20. tapenade-0.0.1/src/tapenade/preprocessing/_local_equalization.py +401 -0
  21. tapenade-0.0.1/src/tapenade/preprocessing/_preprocessing.py +1032 -0
  22. tapenade-0.0.1/src/tapenade/preprocessing/_smoothing.py +144 -0
  23. tapenade-0.0.1/src/tapenade/preprocessing/_tests/__init__.py +0 -0
  24. tapenade-0.0.1/src/tapenade/preprocessing/_thresholding.py +259 -0
  25. tapenade-0.0.1/src/tapenade/preprocessing/segmentation_postprocessing.py +57 -0
  26. tapenade-0.0.1/src/tapenade/reconstruction/__init__.py +31 -0
  27. tapenade-0.0.1/src/tapenade/reconstruction/_reconstruct.py +683 -0
  28. tapenade-0.0.1/src/tapenade/segmentation/__init__.py +2 -0
  29. tapenade-0.0.1/src/tapenade/segmentation/_segment.py +129 -0
  30. tapenade-0.0.1/src/tapenade/utils.py +80 -0
  31. tapenade-0.0.1/src/tapenade.egg-info/PKG-INFO +213 -0
  32. tapenade-0.0.1/src/tapenade.egg-info/SOURCES.txt +35 -0
  33. tapenade-0.0.1/src/tapenade.egg-info/dependency_links.txt +1 -0
  34. tapenade-0.0.1/src/tapenade.egg-info/entry_points.txt +2 -0
  35. tapenade-0.0.1/src/tapenade.egg-info/requires.txt +22 -0
  36. tapenade-0.0.1/src/tapenade.egg-info/top_level.txt +1 -0
tapenade-0.0.1/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) 2023 Leo Guignard
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
@@ -0,0 +1,5 @@
1
+ include LICENSE
2
+ include README.md
3
+
4
+ recursive-exclude * __pycache__
5
+ recursive-exclude * *.py[co]
@@ -0,0 +1,213 @@
1
+ Metadata-Version: 2.1
2
+ Name: tapenade
3
+ Version: 0.0.1
4
+ Summary: A repository to process organoid images
5
+ Home-page: https://github.com/GuignardLab/tapenade
6
+ Author: Leo Guignard
7
+ Author-email: leo.guignard@univ-amu.fr
8
+ License: MIT
9
+ Project-URL: Bug Tracker, https://github.com/GuignardLab/tapenade/issues
10
+ Project-URL: Documentation, https://github.com/GuignardLab/tapenade#README.md
11
+ Project-URL: Source Code, https://github.com/GuignardLab/tapenade
12
+ Project-URL: User Support, https://github.com/GuignardLab/tapenade/issues
13
+ Classifier: Development Status :: 2 - Pre-Alpha
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: License :: OSI Approved :: MIT License
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3 :: Only
20
+ Classifier: Programming Language :: Python :: 3.8
21
+ Classifier: Programming Language :: Python :: 3.9
22
+ Classifier: Programming Language :: Python :: 3.10
23
+ Classifier: Programming Language :: Python :: 3.11
24
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
25
+ Requires-Python: >=3.8
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: tbb
29
+ Requires-Dist: scipy
30
+ Requires-Dist: jupyter
31
+ Requires-Dist: numba
32
+ Requires-Dist: numpy
33
+ Requires-Dist: scikit-image
34
+ Requires-Dist: scikit-learn
35
+ Requires-Dist: tifffile
36
+ Requires-Dist: matplotlib
37
+ Requires-Dist: 3d-registration>=0.5.2
38
+ Requires-Dist: tqdm
39
+ Provides-Extra: testing
40
+ Requires-Dist: tox; extra == "testing"
41
+ Requires-Dist: pytest; extra == "testing"
42
+ Requires-Dist: pytest-cov; extra == "testing"
43
+ Provides-Extra: dev
44
+ Requires-Dist: bumpver; extra == "dev"
45
+ Requires-Dist: ruff; extra == "dev"
46
+ Requires-Dist: black[jupyter]; extra == "dev"
47
+ Requires-Dist: pytest; extra == "dev"
48
+
49
+ # :herb: Tapenade : Thorough Analysis PiEliNe for Advanced DEep imaging
50
+
51
+ [![License MIT](https://img.shields.io/pypi/l/tapenade.svg?color=green)](https://github.com/GuignardLab/tapenade/raw/main/LICENSE)
52
+ [![PyPI](https://img.shields.io/pypi/v/tapenade.svg?color=green)](https://pypi.org/project/tapenade)
53
+ [![Python Version](https://img.shields.io/pypi/pyversions/tapenade.svg?color=green)](https://python.org)
54
+ [![tests](https://github.com/GuignardLab/tapenade/workflows/tests/badge.svg)](https://github.com/GuignardLab/tapenade/actions)
55
+ [![codecov](https://codecov.io/gh/GuignardLab/tapenade/branch/main/graph/badge.svg)](https://codecov.io/gh/GuignardLab/tapenade)
56
+
57
+ <img src="https://github.com/GuignardLab/tapenade/blob/Packaging/imgs/tapenade3.png" width="100">
58
+
59
+ A fully-visual pipeline for quantitative analysis of 3D organoid images acquired with deep imaging microscopy.
60
+
61
+ If you use this plugin for your research, please [cite us](https://github.com/GuignardLab/tapenade/blob/main/README.md#how-to-cite).
62
+
63
+ ----------------------------------
64
+
65
+ ## Table of contents
66
+
67
+ - [Overview](#overview)
68
+ - [Installation](#installation)
69
+ - [Usage](#usage)
70
+ - [Complementary Napari plugins (for graphical user interfaces)](#complementary-napari-plugins-for-graphical-user-interfaces)
71
+ - [How to cite](#how-to-cite)
72
+ - [Contributing](#contributing)
73
+ - [License](#license)
74
+ - [Issues](#issues)
75
+
76
+ ## Overview
77
+
78
+ <img src="https://github.com/GuignardLab/tapenade/blob/Packaging/imgs/Fig_overview_github.png" width="1000">
79
+
80
+ The Tapenade pipeline is a tool for the analysis of dense 3D tissues acquired with deep imaging microscopy. It is designed to be user-friendly and to provide a comprehensive analysis of the data. The pipeline is composed of several steps, each of which can be run independently.
81
+
82
+ The pipeline is composed of the following methods:
83
+
84
+ 1. **Spectral filtering**: Given a set of calibrated emission spectra, allows the unmixing of the different fluorophores present in the image.
85
+ 2. **Registration & fusion**: Allows for spatial fusion of two images (e.g. acquired with a dual-view microscope).
86
+ 3. **Pre-processing**: Provides many pre-processing functions, like rescaling, masking, correction of optical artifcats, etc.
87
+ 4. **Segmentation**: Detect and seperate each nuclei in the image. We provide trained weights for StarDist3D, a state-of-the-art deep learning model for nuclei segmentation.
88
+ 4. **Masked smoothing**: Produces smooth fields of a given dense or sparse quantity, which allows for multiscale analysis.
89
+ 5. **Spatial correlation analysis**: Computes a spatial correlation map between two continuous fields.
90
+ 6. **Deformation tensors analysis**: Computes deformation tensors (inertia, true strain, etc.) from segmented objects.
91
+
92
+ All methods are explained in details in our Jupyter notebooks, which are available in the [notebooks](notebooks/) folder.
93
+
94
+
95
+ ## Installation
96
+
97
+ ### Main library
98
+
99
+ We recommand to install the library in a specific environement (like [conda]). To create a new environement, you can run the following command:
100
+
101
+ conda create -n env-tapenade python=3.10
102
+ You can then activate the environement with:
103
+
104
+ conda activate env-tapenade
105
+
106
+ For here onward, it is assumed that you are running the commands from the `env-tapenade` [conda] environement.
107
+
108
+ You can install `tapenade` via [pip]:
109
+
110
+ ```shell
111
+ pip install tapenade
112
+ ```
113
+
114
+ To install the latest development version:
115
+
116
+ ```shell
117
+ pip install git+https://github.com/GuignardLab/tapenade.git
118
+ ```
119
+
120
+ To install the latest development version in editable mode:
121
+
122
+ ```shell
123
+ git clone git@github.com:GuignardLab/tapenade.git
124
+ cd tapenade
125
+ pip install -e .
126
+ ```
127
+
128
+ This will install only the main library, without the libraries for the registration/fusion and segmentation methods. To install them, please follow the instructions below.
129
+
130
+ ### Registration and fusion (optional)
131
+
132
+ The registration and fusion methods require the `3D-registration` Python package. To install it, follow the instructions on the library's [repository](https://github.com/GuignardLab/tapenade/tree/Packaging?tab=readme-ov-file#installation).
133
+
134
+ ### Segmentation (optional)
135
+
136
+ We provide trained weights for StarDist3D, a state-of-the-art deep learning model for nuclei segmentation. To install Stardist3D, follow the instructions on the library's [repository](https://github.com/GuignardLab/tapenade/tree/Packaging?tab=readme-ov-file#installation).
137
+
138
+ If you prefer to use StarDist3D with a graphical user interface, Stardist3D is also available as a plugin in several softwares, like [Napari](https://github.com/stardist/stardist-napari), [Fiji](https://imagej.net/plugins/stardist), and [Icy](https://github.com/stardist/stardist-icy) (more details on the [Stardist3D repository](https://github.com/stardist/stardist?tab=readme-ov-file#plugins-for-other-software)).
139
+
140
+ We highly recommend using the `change_arrays_pixelsize` and `local_image_equalization` methods (defined [here](https://github.com/GuignardLab/tapenade/blob/main/src/tapenade/preprocessing/_preprocessing.py)) from our library to preprocess your data before running the inference with our custom StarDist3D weights.
141
+
142
+ Though not mandatory, we also recommend running the inference with StarDist3D on a GPU for faster results. If you don't have a GPU, you can use the ZeroCostDL4Mic Google Colab notebooks, which allow you to run the inference on a GPU for free. You can find the ZeroCostDL4Mic notebooks for StarDist3D [here](https://colab.research.google.com/github/HenriquesLab/ZeroCostDL4Mic/blob/master/Colab_notebooks/StarDist_3D_ZeroCostDL4Mic.ipynb).
143
+
144
+ ## Usage
145
+
146
+ The methods described above are available at the following locations:
147
+
148
+ 1. **Spectral filtering**: [Code](preprocessing.spectral_filtering.XXX), [Notebook](notebooks/spectral_filtering_notebook.ipynb)
149
+ 2. **Registration & fusion**: [Code](reconstruction.register), [Notebook](notebooks/registration_notebook.ipynb)
150
+ 3. **Pre-processing**: This [script](analysis.preprocessing._preprocessing.py) gathers all preprocessing functions, [Notebook](notebooks/preprocessing_notebook.ipynb)
151
+ 4. **Segmentation**: [Code](segmentation.predict_stardist), [Notebook](notebooks/segmentation_notebook.ipynb)
152
+ 4. **Masked smoothing**: [Code](preprocessing.masked_smooth_gaussian), [Notebook](notebooks/masked_gaussian_smoothing_notebook.ipynb)
153
+ 5. **Spatial correlation analysis**: [Code](analysis.spatial_correlation.SpatialCorrelationPlotter), [Notebook](notebooks/spatial_correlation_analysis_notebook.ipynb)
154
+ 6. **Deformation tensors analysis**: [Code](analysis.deformation.XXX), [Notebook](notebooks/deformation_analysis_notebook.ipynb)
155
+
156
+ All methods are explained in details in our Jupyter notebooks, which are available in the [notebooks](notebooks/) folder.
157
+
158
+ ## Complementary Napari plugins (for graphical user interfaces)
159
+
160
+ During the pre-processing stage, dynamical exploration and interaction led to faster tuning of the parameters by allowing direct visual feedback, and gave key biophysical insight during the analysis stage.
161
+ We thus created three user-friendly Napari plugins designed around facilitating such interactions:
162
+
163
+ 1. **napari-organoid-registration** (available [here](https://github.com/GuignardLab/napari-manual-registration))
164
+ When using our automatic registration tool to spatially register two views of the same organoid, we were sometimes faced with the issue that the tool would not converge to the true registration transformation. This happens when the initial position and orientation of the floating view are too far from their target values. We thus designed a Napari plugin to quickly find a transformation that can be used to initialize our registration tool close to the optimal transformation. From two images loaded in Napari representing two views of the same organoid, the plugin allows the user to either (i) manually define a rigid transformation by continually varying 3D rotations and translations while observing the results until a satisfying fit is found, or to (ii) annotate matching salient landmarks (e.g bright dead cells or lumen-like structures) in both the reference and floating views, from which an optimal rigid transformation can be found automatically using principal component analysis.
165
+
166
+ 2. **napari-organoid-preprocessing** (available [here](https://github.com/GuignardLab/napari-tapenade-processing))
167
+ From a given set of raw images, segmented object instances, and object mask, the plugin allows the user to quickly run all pre-processing functions from our main pipeline with custom parameters while being able to see and interact with the result of each step. For large datasets that are cumbersome to manipulate or cannot be loaded in Napari, the plugin provides a macro recording feature: the users can experiment and design their own pipeline on a smaller subset of the dataset, then run it on the full dataset without having to load it in Napari.
168
+
169
+ 2. **napari-spatial-correlation-plotter** (available [here](https://github.com/GuignardLab/napari-spatial-correlation-plotter))
170
+ This plugins allows the user to analyse the spatial correlations of two 3D fields loaded in Napari (e.g two fluorescent markers). The user can dynamically vary the analysis length scale, which corresponds to the standard deviation of the Gaussian kernel used for smoothing the 3D fields.
171
+ If a layer of segmented nuclei instances is additionally specified, the histogram is constructed by binning values at the nuclei level (each point corresponds to an individual nucleus). Otherwise, individual voxel values are used.
172
+ The user can dynamically interact with the correlation heatmap by manually selecting a region in the plot. The corresponding cells (or voxels) that contributed to the region's statistics will be displayed in 3D on an independant Napari layer for the user to interact with and gain biological insight.
173
+
174
+ ## How to cite
175
+
176
+ If you use this plugin for your research, please cite us using the following reference:
177
+
178
+ [DOI in progress]
179
+
180
+ This repository has been developed by (in alphabetical order):
181
+
182
+ - [Alice Gros](mailto:alice.gros@univ-amu.fr)
183
+ - [Jules Vanaret](mailto:jules.vanaret@univ-amu.fr)
184
+ - [Léo Guignard](mailto:leo.guignard@univ-amu.fr)
185
+ - [Valentin Dunsing-Eichenauer](valentin.dunsing@univ-amu.fr)
186
+
187
+ ## Contributing
188
+
189
+ Contributions are very welcome. Tests can be run with [tox] or [pytest], please ensure
190
+ the coverage at least stays the same before you submit a pull request.
191
+
192
+ ## License
193
+
194
+ Distributed under the terms of the [MIT] license,
195
+ "tapenade" is free and open source software
196
+
197
+ ## Issues
198
+
199
+ If you encounter any problems, please [file an issue] along with a detailed description.
200
+
201
+ ----------------------------------
202
+
203
+ This library was generated using [Cookiecutter] and a custom made template based on [@napari]'s [cookiecutter-napari-plugin] template.
204
+
205
+ [Cookiecutter]: https://github.com/audreyr/cookiecutter
206
+ [@napari]: https://github.com/napari
207
+ [MIT]: http://opensource.org/licenses/MIT
208
+ [cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin
209
+ [pip]: https://pypi.org/project/pip/
210
+ [tox]: https://tox.readthedocs.io/en/latest/
211
+ [pytest]: https://docs.pytest.org/
212
+ [conda]: https://conda.io/projects/conda/en/latest/user-guide/install/index.html
213
+ [file an issue]: https://github.com/GuignardLab/tapenade/issues
@@ -0,0 +1,165 @@
1
+ # :herb: Tapenade : Thorough Analysis PiEliNe for Advanced DEep imaging
2
+
3
+ [![License MIT](https://img.shields.io/pypi/l/tapenade.svg?color=green)](https://github.com/GuignardLab/tapenade/raw/main/LICENSE)
4
+ [![PyPI](https://img.shields.io/pypi/v/tapenade.svg?color=green)](https://pypi.org/project/tapenade)
5
+ [![Python Version](https://img.shields.io/pypi/pyversions/tapenade.svg?color=green)](https://python.org)
6
+ [![tests](https://github.com/GuignardLab/tapenade/workflows/tests/badge.svg)](https://github.com/GuignardLab/tapenade/actions)
7
+ [![codecov](https://codecov.io/gh/GuignardLab/tapenade/branch/main/graph/badge.svg)](https://codecov.io/gh/GuignardLab/tapenade)
8
+
9
+ <img src="https://github.com/GuignardLab/tapenade/blob/Packaging/imgs/tapenade3.png" width="100">
10
+
11
+ A fully-visual pipeline for quantitative analysis of 3D organoid images acquired with deep imaging microscopy.
12
+
13
+ If you use this plugin for your research, please [cite us](https://github.com/GuignardLab/tapenade/blob/main/README.md#how-to-cite).
14
+
15
+ ----------------------------------
16
+
17
+ ## Table of contents
18
+
19
+ - [Overview](#overview)
20
+ - [Installation](#installation)
21
+ - [Usage](#usage)
22
+ - [Complementary Napari plugins (for graphical user interfaces)](#complementary-napari-plugins-for-graphical-user-interfaces)
23
+ - [How to cite](#how-to-cite)
24
+ - [Contributing](#contributing)
25
+ - [License](#license)
26
+ - [Issues](#issues)
27
+
28
+ ## Overview
29
+
30
+ <img src="https://github.com/GuignardLab/tapenade/blob/Packaging/imgs/Fig_overview_github.png" width="1000">
31
+
32
+ The Tapenade pipeline is a tool for the analysis of dense 3D tissues acquired with deep imaging microscopy. It is designed to be user-friendly and to provide a comprehensive analysis of the data. The pipeline is composed of several steps, each of which can be run independently.
33
+
34
+ The pipeline is composed of the following methods:
35
+
36
+ 1. **Spectral filtering**: Given a set of calibrated emission spectra, allows the unmixing of the different fluorophores present in the image.
37
+ 2. **Registration & fusion**: Allows for spatial fusion of two images (e.g. acquired with a dual-view microscope).
38
+ 3. **Pre-processing**: Provides many pre-processing functions, like rescaling, masking, correction of optical artifcats, etc.
39
+ 4. **Segmentation**: Detect and seperate each nuclei in the image. We provide trained weights for StarDist3D, a state-of-the-art deep learning model for nuclei segmentation.
40
+ 4. **Masked smoothing**: Produces smooth fields of a given dense or sparse quantity, which allows for multiscale analysis.
41
+ 5. **Spatial correlation analysis**: Computes a spatial correlation map between two continuous fields.
42
+ 6. **Deformation tensors analysis**: Computes deformation tensors (inertia, true strain, etc.) from segmented objects.
43
+
44
+ All methods are explained in details in our Jupyter notebooks, which are available in the [notebooks](notebooks/) folder.
45
+
46
+
47
+ ## Installation
48
+
49
+ ### Main library
50
+
51
+ We recommand to install the library in a specific environement (like [conda]). To create a new environement, you can run the following command:
52
+
53
+ conda create -n env-tapenade python=3.10
54
+ You can then activate the environement with:
55
+
56
+ conda activate env-tapenade
57
+
58
+ For here onward, it is assumed that you are running the commands from the `env-tapenade` [conda] environement.
59
+
60
+ You can install `tapenade` via [pip]:
61
+
62
+ ```shell
63
+ pip install tapenade
64
+ ```
65
+
66
+ To install the latest development version:
67
+
68
+ ```shell
69
+ pip install git+https://github.com/GuignardLab/tapenade.git
70
+ ```
71
+
72
+ To install the latest development version in editable mode:
73
+
74
+ ```shell
75
+ git clone git@github.com:GuignardLab/tapenade.git
76
+ cd tapenade
77
+ pip install -e .
78
+ ```
79
+
80
+ This will install only the main library, without the libraries for the registration/fusion and segmentation methods. To install them, please follow the instructions below.
81
+
82
+ ### Registration and fusion (optional)
83
+
84
+ The registration and fusion methods require the `3D-registration` Python package. To install it, follow the instructions on the library's [repository](https://github.com/GuignardLab/tapenade/tree/Packaging?tab=readme-ov-file#installation).
85
+
86
+ ### Segmentation (optional)
87
+
88
+ We provide trained weights for StarDist3D, a state-of-the-art deep learning model for nuclei segmentation. To install Stardist3D, follow the instructions on the library's [repository](https://github.com/GuignardLab/tapenade/tree/Packaging?tab=readme-ov-file#installation).
89
+
90
+ If you prefer to use StarDist3D with a graphical user interface, Stardist3D is also available as a plugin in several softwares, like [Napari](https://github.com/stardist/stardist-napari), [Fiji](https://imagej.net/plugins/stardist), and [Icy](https://github.com/stardist/stardist-icy) (more details on the [Stardist3D repository](https://github.com/stardist/stardist?tab=readme-ov-file#plugins-for-other-software)).
91
+
92
+ We highly recommend using the `change_arrays_pixelsize` and `local_image_equalization` methods (defined [here](https://github.com/GuignardLab/tapenade/blob/main/src/tapenade/preprocessing/_preprocessing.py)) from our library to preprocess your data before running the inference with our custom StarDist3D weights.
93
+
94
+ Though not mandatory, we also recommend running the inference with StarDist3D on a GPU for faster results. If you don't have a GPU, you can use the ZeroCostDL4Mic Google Colab notebooks, which allow you to run the inference on a GPU for free. You can find the ZeroCostDL4Mic notebooks for StarDist3D [here](https://colab.research.google.com/github/HenriquesLab/ZeroCostDL4Mic/blob/master/Colab_notebooks/StarDist_3D_ZeroCostDL4Mic.ipynb).
95
+
96
+ ## Usage
97
+
98
+ The methods described above are available at the following locations:
99
+
100
+ 1. **Spectral filtering**: [Code](preprocessing.spectral_filtering.XXX), [Notebook](notebooks/spectral_filtering_notebook.ipynb)
101
+ 2. **Registration & fusion**: [Code](reconstruction.register), [Notebook](notebooks/registration_notebook.ipynb)
102
+ 3. **Pre-processing**: This [script](analysis.preprocessing._preprocessing.py) gathers all preprocessing functions, [Notebook](notebooks/preprocessing_notebook.ipynb)
103
+ 4. **Segmentation**: [Code](segmentation.predict_stardist), [Notebook](notebooks/segmentation_notebook.ipynb)
104
+ 4. **Masked smoothing**: [Code](preprocessing.masked_smooth_gaussian), [Notebook](notebooks/masked_gaussian_smoothing_notebook.ipynb)
105
+ 5. **Spatial correlation analysis**: [Code](analysis.spatial_correlation.SpatialCorrelationPlotter), [Notebook](notebooks/spatial_correlation_analysis_notebook.ipynb)
106
+ 6. **Deformation tensors analysis**: [Code](analysis.deformation.XXX), [Notebook](notebooks/deformation_analysis_notebook.ipynb)
107
+
108
+ All methods are explained in details in our Jupyter notebooks, which are available in the [notebooks](notebooks/) folder.
109
+
110
+ ## Complementary Napari plugins (for graphical user interfaces)
111
+
112
+ During the pre-processing stage, dynamical exploration and interaction led to faster tuning of the parameters by allowing direct visual feedback, and gave key biophysical insight during the analysis stage.
113
+ We thus created three user-friendly Napari plugins designed around facilitating such interactions:
114
+
115
+ 1. **napari-organoid-registration** (available [here](https://github.com/GuignardLab/napari-manual-registration))
116
+ When using our automatic registration tool to spatially register two views of the same organoid, we were sometimes faced with the issue that the tool would not converge to the true registration transformation. This happens when the initial position and orientation of the floating view are too far from their target values. We thus designed a Napari plugin to quickly find a transformation that can be used to initialize our registration tool close to the optimal transformation. From two images loaded in Napari representing two views of the same organoid, the plugin allows the user to either (i) manually define a rigid transformation by continually varying 3D rotations and translations while observing the results until a satisfying fit is found, or to (ii) annotate matching salient landmarks (e.g bright dead cells or lumen-like structures) in both the reference and floating views, from which an optimal rigid transformation can be found automatically using principal component analysis.
117
+
118
+ 2. **napari-organoid-preprocessing** (available [here](https://github.com/GuignardLab/napari-tapenade-processing))
119
+ From a given set of raw images, segmented object instances, and object mask, the plugin allows the user to quickly run all pre-processing functions from our main pipeline with custom parameters while being able to see and interact with the result of each step. For large datasets that are cumbersome to manipulate or cannot be loaded in Napari, the plugin provides a macro recording feature: the users can experiment and design their own pipeline on a smaller subset of the dataset, then run it on the full dataset without having to load it in Napari.
120
+
121
+ 2. **napari-spatial-correlation-plotter** (available [here](https://github.com/GuignardLab/napari-spatial-correlation-plotter))
122
+ This plugins allows the user to analyse the spatial correlations of two 3D fields loaded in Napari (e.g two fluorescent markers). The user can dynamically vary the analysis length scale, which corresponds to the standard deviation of the Gaussian kernel used for smoothing the 3D fields.
123
+ If a layer of segmented nuclei instances is additionally specified, the histogram is constructed by binning values at the nuclei level (each point corresponds to an individual nucleus). Otherwise, individual voxel values are used.
124
+ The user can dynamically interact with the correlation heatmap by manually selecting a region in the plot. The corresponding cells (or voxels) that contributed to the region's statistics will be displayed in 3D on an independant Napari layer for the user to interact with and gain biological insight.
125
+
126
+ ## How to cite
127
+
128
+ If you use this plugin for your research, please cite us using the following reference:
129
+
130
+ [DOI in progress]
131
+
132
+ This repository has been developed by (in alphabetical order):
133
+
134
+ - [Alice Gros](mailto:alice.gros@univ-amu.fr)
135
+ - [Jules Vanaret](mailto:jules.vanaret@univ-amu.fr)
136
+ - [Léo Guignard](mailto:leo.guignard@univ-amu.fr)
137
+ - [Valentin Dunsing-Eichenauer](valentin.dunsing@univ-amu.fr)
138
+
139
+ ## Contributing
140
+
141
+ Contributions are very welcome. Tests can be run with [tox] or [pytest], please ensure
142
+ the coverage at least stays the same before you submit a pull request.
143
+
144
+ ## License
145
+
146
+ Distributed under the terms of the [MIT] license,
147
+ "tapenade" is free and open source software
148
+
149
+ ## Issues
150
+
151
+ If you encounter any problems, please [file an issue] along with a detailed description.
152
+
153
+ ----------------------------------
154
+
155
+ This library was generated using [Cookiecutter] and a custom made template based on [@napari]'s [cookiecutter-napari-plugin] template.
156
+
157
+ [Cookiecutter]: https://github.com/audreyr/cookiecutter
158
+ [@napari]: https://github.com/napari
159
+ [MIT]: http://opensource.org/licenses/MIT
160
+ [cookiecutter-napari-plugin]: https://github.com/napari/cookiecutter-napari-plugin
161
+ [pip]: https://pypi.org/project/pip/
162
+ [tox]: https://tox.readthedocs.io/en/latest/
163
+ [pytest]: https://docs.pytest.org/
164
+ [conda]: https://conda.io/projects/conda/en/latest/user-guide/install/index.html
165
+ [file an issue]: https://github.com/GuignardLab/tapenade/issues
@@ -0,0 +1,77 @@
1
+ [build-system]
2
+ requires = ["setuptools>=42.0.0", "wheel"]
3
+ build-backend = "setuptools.build_meta"
4
+
5
+ [tool.black]
6
+ line-length = 79
7
+
8
+ [tool.isort]
9
+ profile = "black"
10
+ line_length = 79
11
+
12
+
13
+ [tool.bumpver]
14
+ current_version = "0.0.1"
15
+ version_pattern = "MAJOR.MINOR.PATCH[-TAG]"
16
+ commit_message = "bump version {old_version} -> {new_version}"
17
+ commit = true
18
+ tag = true
19
+ push = false
20
+
21
+ [tool.bumpver.file_patterns]
22
+ "pyproject.toml" = [
23
+ 'current_version = "{version}"',
24
+ ]
25
+ "src/tapenade/__init__.py" = [
26
+ '__version__ = "{version}"',
27
+ ]
28
+ "setup.cfg" = [
29
+ "version = {version}"
30
+ ]
31
+
32
+ [tool.ruff]
33
+ line-length = 79
34
+ select = [
35
+ "E", "F", "W", #flake8
36
+ "UP", # pyupgrade
37
+ "I", # isort
38
+ "BLE", # flake8-blind-exception
39
+ "B", # flake8-bugbear
40
+ "A", # flake8-builtins
41
+ "C4", # flake8-comprehensions
42
+ "ISC", # flake8-implicit-str-concat
43
+ "G", # flake8-logging-format
44
+ "PIE", # flake8-pie
45
+ "SIM", # flake8-simplify
46
+ ]
47
+ ignore = [
48
+ "E501", # line too long. let black handle this
49
+ "UP006", "UP007", # type annotation. As using magicgui require runtime type annotation then we disable this.
50
+ "SIM117", # flake8-simplify - some of merged with statements are not looking great with black, reanble after drop python 3.9
51
+ ]
52
+
53
+ exclude = [
54
+ ".bzr",
55
+ ".direnv",
56
+ ".eggs",
57
+ ".git",
58
+ ".mypy_cache",
59
+ ".pants.d",
60
+ ".ruff_cache",
61
+ ".svn",
62
+ ".tox",
63
+ ".venv",
64
+ "__pypackages__",
65
+ "_build",
66
+ "buck-out",
67
+ "build",
68
+ "dist",
69
+ "node_modules",
70
+ "venv",
71
+ "*vendored*",
72
+ "*_vendor*",
73
+ ]
74
+
75
+ target-version = "py310"
76
+ fix = true
77
+
@@ -0,0 +1,74 @@
1
+ [metadata]
2
+ name = tapenade
3
+ version = 0.0.1
4
+ description = A repository to process organoid images
5
+ long_description = file: README.md
6
+ long_description_content_type = text/markdown
7
+ url = https://github.com/GuignardLab/tapenade
8
+ author = Leo Guignard
9
+ author_email = leo.guignard@univ-amu.fr
10
+ license = MIT
11
+ license_files = LICENSE
12
+ classifiers =
13
+ Development Status :: 2 - Pre-Alpha
14
+ Intended Audience :: Developers
15
+ License :: OSI Approved :: MIT License
16
+ Operating System :: OS Independent
17
+ Programming Language :: Python
18
+ Programming Language :: Python :: 3
19
+ Programming Language :: Python :: 3 :: Only
20
+ Programming Language :: Python :: 3.8
21
+ Programming Language :: Python :: 3.9
22
+ Programming Language :: Python :: 3.10
23
+ Programming Language :: Python :: 3.11
24
+ Topic :: Scientific/Engineering :: Image Processing
25
+ project_urls =
26
+ Bug Tracker = https://github.com/GuignardLab/tapenade/issues
27
+ Documentation = https://github.com/GuignardLab/tapenade#README.md
28
+ Source Code = https://github.com/GuignardLab/tapenade
29
+ User Support = https://github.com/GuignardLab/tapenade/issues
30
+
31
+ [options]
32
+ packages = find:
33
+ install_requires =
34
+ tbb
35
+ scipy
36
+ jupyter
37
+ numba
38
+ numpy
39
+ scikit-image
40
+ scikit-learn
41
+ tifffile
42
+ matplotlib
43
+ 3d-registration >= 0.5.2
44
+ tqdm
45
+ python_requires = >=3.8
46
+ include_package_data = True
47
+ package_dir =
48
+ =src
49
+
50
+ [options.entry_points]
51
+ console_scripts =
52
+ foo-script = tapenade:reconstruction.script_run
53
+
54
+ [options.packages.find]
55
+ where = src
56
+
57
+ [options.extras_require]
58
+ testing =
59
+ tox
60
+ pytest # https://docs.pytest.org/en/latest/contents.html
61
+ pytest-cov # https://pytest-cov.readthedocs.io/en/latest/
62
+ dev =
63
+ bumpver
64
+ ruff
65
+ black[jupyter]
66
+ pytest
67
+
68
+ [options.package_data]
69
+ * = *.yaml
70
+
71
+ [egg_info]
72
+ tag_build =
73
+ tag_date = 0
74
+
@@ -0,0 +1 @@
1
+ __version__ = "0.0.1"
File without changes
File without changes
@@ -0,0 +1,22 @@
1
+ from additional_regionprops_properties import (
2
+ add_principal_lengths,
3
+ add_tensor_inertia,
4
+ add_true_strain_tensor,
5
+ add_ellipsoidal_coefficients,
6
+ add_ellipsoidal_nature,
7
+ add_ellipsoidal_nature_bool,
8
+ add_anisotropy_coefficient,
9
+ )
10
+
11
+ from deformation_quantification import tensors_to_napari_vectors
12
+
13
+ __all__ = [
14
+ "add_principal_lengths",
15
+ "add_tensor_inertia",
16
+ "add_true_strain_tensor",
17
+ "add_ellipsoidal_coefficients",
18
+ "add_ellipsoidal_nature",
19
+ "add_ellipsoidal_nature_bool",
20
+ "add_anisotropy_coefficient",
21
+ "tensors_to_napari_vectors",
22
+ ]