waveorder 2.1.0__tar.gz → 2.2.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 (89) hide show
  1. {waveorder-2.1.0 → waveorder-2.2.0}/.github/workflows/pytests.yml +1 -1
  2. {waveorder-2.1.0 → waveorder-2.2.0}/.gitignore +1 -0
  3. {waveorder-2.1.0 → waveorder-2.2.0}/CITATION.cff +16 -13
  4. waveorder-2.2.0/PKG-INFO +186 -0
  5. waveorder-2.2.0/README.md +118 -0
  6. waveorder-2.2.0/examples/README.md +10 -0
  7. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/PTI_experiment/PTI_Experiment_Recon3D_anisotropic_target_small.py +14 -13
  8. {waveorder-2.1.0 → waveorder-2.2.0}/examples/maintenance/PTI_simulation/PTI_Simulation_Forward_2D3D.py +10 -10
  9. {waveorder-2.1.0 → waveorder-2.2.0}/examples/maintenance/PTI_simulation/PTI_Simulation_Recon2D.py +8 -8
  10. {waveorder-2.1.0 → waveorder-2.2.0}/examples/maintenance/PTI_simulation/PTI_Simulation_Recon3D.py +11 -11
  11. {waveorder-2.1.0 → waveorder-2.2.0}/examples/maintenance/QLIPP_simulation/2D_QLIPP_forward.py +3 -3
  12. {waveorder-2.1.0 → waveorder-2.2.0}/examples/maintenance/QLIPP_simulation/2D_QLIPP_recon.py +7 -7
  13. {waveorder-2.1.0 → waveorder-2.2.0}/examples/models/README.md +4 -2
  14. waveorder-2.2.0/examples/models/inplane_oriented_thick_pol3d_vector.py +92 -0
  15. {waveorder-2.1.0 → waveorder-2.2.0}/examples/models/isotropic_fluorescent_thick_3d.py +2 -2
  16. {waveorder-2.1.0 → waveorder-2.2.0}/examples/models/phase_thick_3d.py +2 -3
  17. waveorder-2.2.0/examples/visuals/plot_greens_tensor.py +139 -0
  18. waveorder-2.2.0/examples/visuals/plot_vector_transfer_function_support.py +241 -0
  19. waveorder-2.2.0/pyproject.toml +71 -0
  20. waveorder-2.2.0/setup.cfg +4 -0
  21. waveorder-2.2.0/tests/models/test_phase_thick_3d.py +101 -0
  22. {waveorder-2.1.0 → waveorder-2.2.0}/tests/test_focus_estimator.py +12 -3
  23. {waveorder-2.1.0 → waveorder-2.2.0}/tests/test_optics.py +1 -1
  24. waveorder-2.2.0/tests/test_sampling.py +13 -0
  25. {waveorder-2.1.0 → waveorder-2.2.0}/tests/test_util.py +18 -0
  26. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/_version.py +2 -2
  27. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/focus.py +36 -18
  28. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/models/inplane_oriented_thick_pol3d.py +12 -12
  29. waveorder-2.2.0/waveorder/models/inplane_oriented_thick_pol3d_vector.py +351 -0
  30. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/models/isotropic_fluorescent_thick_3d.py +86 -33
  31. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/models/isotropic_thin_3d.py +94 -32
  32. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/models/phase_thick_3d.py +107 -63
  33. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/optics.py +242 -28
  34. waveorder-2.2.0/waveorder/sampling.py +94 -0
  35. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/util.py +54 -2
  36. waveorder-2.1.0/waveorder/visual.py → waveorder-2.2.0/waveorder/visuals/jupyter_visuals.py +2 -6
  37. waveorder-2.2.0/waveorder/visuals/matplotlib_visuals.py +335 -0
  38. waveorder-2.2.0/waveorder/visuals/napari_visuals.py +77 -0
  39. waveorder-2.2.0/waveorder/visuals/utils.py +31 -0
  40. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/waveorder_reconstructor.py +8 -7
  41. waveorder-2.2.0/waveorder.egg-info/PKG-INFO +186 -0
  42. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder.egg-info/SOURCES.txt +12 -6
  43. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder.egg-info/requires.txt +7 -4
  44. waveorder-2.1.0/PKG-INFO +0 -124
  45. waveorder-2.1.0/README.md +0 -82
  46. waveorder-2.1.0/examples/README.md +0 -7
  47. waveorder-2.1.0/examples/models/isotropic_thin_3d_resolution.py +0 -88
  48. waveorder-2.1.0/pyproject.toml +0 -13
  49. waveorder-2.1.0/setup.cfg +0 -55
  50. waveorder-2.1.0/setup.py +0 -3
  51. waveorder-2.1.0/tests/models/test_phase_thick_3d.py +0 -22
  52. waveorder-2.1.0/waveorder.egg-info/PKG-INFO +0 -124
  53. {waveorder-2.1.0 → waveorder-2.2.0}/.git-blame-ignore-revs +0 -0
  54. {waveorder-2.1.0 → waveorder-2.2.0}/LICENSE +0 -0
  55. {waveorder-2.1.0 → waveorder-2.2.0}/docs/valuable-prs/2023-02-27.110.pr.open.md +0 -0
  56. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/PTI_experiment/PTI_Experiment_Recon3D_anisotropic_target_small.pdf +0 -0
  57. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/PTI_experiment/PTI_full_FOV_anisotropic_target.ipynb +0 -0
  58. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/PTI_experiment/PTI_full_FOV_cardiac_muscle.ipynb +0 -0
  59. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/PTI_experiment/PTI_full_FOV_cardiomyocyte_infected_1.ipynb +0 -0
  60. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/PTI_experiment/PTI_full_FOV_cardiomyocyte_infected_2.ipynb +0 -0
  61. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/PTI_experiment/PTI_full_FOV_cardiomyocyte_mock.ipynb +0 -0
  62. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/PTI_experiment/PTI_full_FOV_human_uterus.ipynb +0 -0
  63. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/PTI_experiment/PTI_full_FOV_mouse_brain_aco.ipynb +0 -0
  64. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/PTI_experiment/README.md +0 -0
  65. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/QLIPP_experiment/2D_QLIPP_recon_experiment.ipynb +0 -0
  66. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/QLIPP_experiment/3D_QLIPP_recon_experiment.ipynb +0 -0
  67. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/README.md +0 -0
  68. {waveorder-2.1.0 → waveorder-2.2.0}/examples/documentation/fluorescence_deconvolution/fluorescence_deconv.ipynb +0 -0
  69. {waveorder-2.1.0 → waveorder-2.2.0}/examples/maintenance/PTI_simulation/PTI_formulation.html +0 -0
  70. {waveorder-2.1.0 → waveorder-2.2.0}/examples/maintenance/PTI_simulation/README.md +0 -0
  71. {waveorder-2.1.0 → waveorder-2.2.0}/examples/maintenance/README.md +0 -0
  72. /waveorder-2.1.0/examples/models/inplane_oriented_thick_pol3D.py → /waveorder-2.2.0/examples/models/inplane_oriented_thick_pol3d.py +0 -0
  73. {waveorder-2.1.0 → waveorder-2.2.0}/examples/models/isotropic_thin_3d.py +0 -0
  74. {waveorder-2.1.0 → waveorder-2.2.0}/readme.png +0 -0
  75. {waveorder-2.1.0 → waveorder-2.2.0}/tests/__init__.py +0 -0
  76. {waveorder-2.1.0 → waveorder-2.2.0}/tests/conftest.py +0 -0
  77. {waveorder-2.1.0 → waveorder-2.2.0}/tests/models/test_inplane_oriented_thick_pol3D.py +0 -0
  78. {waveorder-2.1.0 → waveorder-2.2.0}/tests/models/test_isotropic_fluorescent_thick_3d.py +0 -0
  79. {waveorder-2.1.0 → waveorder-2.2.0}/tests/models/test_isotropic_thin_3d.py +0 -0
  80. {waveorder-2.1.0 → waveorder-2.2.0}/tests/test_correction.py +0 -0
  81. {waveorder-2.1.0 → waveorder-2.2.0}/tests/test_examples.py +0 -0
  82. {waveorder-2.1.0 → waveorder-2.2.0}/tests/test_stokes.py +0 -0
  83. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/__init__.py +0 -0
  84. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/background_estimator.py +0 -0
  85. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/correction.py +0 -0
  86. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/stokes.py +0 -0
  87. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder/waveorder_simulator.py +0 -0
  88. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder.egg-info/dependency_links.txt +0 -0
  89. {waveorder-2.1.0 → waveorder-2.2.0}/waveorder.egg-info/top_level.txt +0 -0
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  strategy:
13
13
  matrix:
14
- python-version: ['3.8', '3.9', '3.10']
14
+ python-version: ['3.10', '3.11', '3.12']
15
15
 
16
16
  steps:
17
17
  - name: Checkout repo
@@ -150,3 +150,4 @@ recOrder/_version.py
150
150
  *.npz
151
151
  *.png
152
152
  *.tif[f]
153
+ *.pdf
@@ -4,30 +4,32 @@
4
4
  cff-version: 1.2.0
5
5
  title: waveorder
6
6
  message: >-
7
- A generalist library of wave optical models and inverse
8
- algorithms for label-free imaging of density &
9
- orientation.
7
+ Wave optical models and inverse algorithms for label-agnostic imaging of density & orientation.
10
8
  type: software
11
9
  authors:
12
- - given-names: Li-Hao
13
- family-names: Yeh
14
- affiliation: CZ Biohub
15
- orcid: 'https://orcid.org/0000-0003-2803-5996'
16
10
  - given-names: Talon
17
11
  family-names: Chandler
18
- affiliation: CZ Biohub
12
+ affiliation: Chan Zuckerberg Biohub San Francisco
19
13
  orcid: 'https://orcid.org/0000-0002-3033-674X'
14
+ - given-names: Li-Hao
15
+ family-names: Yeh
16
+ affiliation: Chan Zuckerberg Biohub San Francisco
17
+ orcid: 'https://orcid.org/0000-0003-2803-5996'
20
18
  - given-names: Ivan
21
19
  family-names: Ivanov
22
- affiliation: CZ Biohub
20
+ affiliation: Chan Zuckerberg Biohub San Francisco
23
21
  orcid: 'https://orcid.org/0000-0002-4675-5287'
24
22
  - given-names: Cameron
25
23
  family-names: Foltz
26
- affiliation: CZ Biohub
24
+ affiliation: Chan Zuckerberg Biohub San Francisco
27
25
  orcid: 'https://orcid.org/0000-0001-8933-2172'
26
+ - given-names: Ziwen
27
+ family-names: Liu
28
+ affiliation: Chan Zuckerberg Biohub San Francisco
29
+ orcid: 'https://orcid.org/0000-0001-7482-1299'
28
30
  - given-names: Shalin
29
31
  family-names: Mehta
30
- affiliation: CZ Biohub
32
+ affiliation: Chan Zuckerberg Biohub San Francisco
31
33
  orcid: 'https://orcid.org/0000-0002-2542-3582'
32
34
  identifiers:
33
35
  - type: doi
@@ -67,6 +69,7 @@ keywords:
67
69
  - qlipp
68
70
  - mipolscope
69
71
  - simulation
72
+ - reconstruction
70
73
  license: BSD-3-Clause
71
- version: 1.0.0rc1
72
- date-released: '2023-02-22'
74
+ version: 2.1.0
75
+ date-released: '2024-03-12'
@@ -0,0 +1,186 @@
1
+ Metadata-Version: 2.1
2
+ Name: waveorder
3
+ Version: 2.2.0
4
+ Summary: Wave-optical simulations and deconvolution of optical properties
5
+ Author-email: CZ Biohub SF <compmicro@czbiohub.org>
6
+ Maintainer-email: Talon Chandler <talon.chandler@czbiohub.org>, Shalin Mehta <shalin.mehta@czbiohub.org>
7
+ License: BSD 3-Clause License
8
+
9
+ Copyright (c) 2019, Chan Zuckerberg Biohub
10
+
11
+ Redistribution and use in source and binary forms, with or without
12
+ modification, are permitted provided that the following conditions are met:
13
+
14
+ 1. Redistributions of source code must retain the above copyright notice, this
15
+ list of conditions and the following disclaimer.
16
+
17
+ 2. Redistributions in binary form must reproduce the above copyright notice,
18
+ this list of conditions and the following disclaimer in the documentation
19
+ and/or other materials provided with the distribution.
20
+
21
+ 3. Neither the name of the copyright holder nor the names of its
22
+ contributors may be used to endorse or promote products derived from
23
+ this software without specific prior written permission.
24
+
25
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
26
+ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27
+ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
29
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
30
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
31
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
32
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
33
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
34
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35
+
36
+ Project-URL: Homepage, https://github.com/mehta-lab/waveorder
37
+ Project-URL: Repository, https://github.com/mehta-lab/waveorder
38
+ Project-URL: Issues, https://github.com/mehta-lab/waveorder/issues
39
+ Keywords: simulation,optics,phase,scattering,polarization,label-free,permittivity,reconstruction-algorithm,qlipp,mipolscope,permittivity-tensor-imaging
40
+ Classifier: Development Status :: 4 - Beta
41
+ Classifier: Intended Audience :: Science/Research
42
+ Classifier: License :: OSI Approved :: BSD License
43
+ Classifier: Programming Language :: Python :: 3
44
+ Classifier: Programming Language :: Python :: 3.10
45
+ Classifier: Programming Language :: Python :: 3.11
46
+ Classifier: Programming Language :: Python :: 3.12
47
+ Classifier: Topic :: Scientific/Engineering
48
+ Classifier: Topic :: Scientific/Engineering :: Image Processing
49
+ Classifier: Topic :: Scientific/Engineering :: Bio-Informatics
50
+ Classifier: Operating System :: POSIX :: Linux
51
+ Classifier: Operating System :: Microsoft :: Windows
52
+ Classifier: Operating System :: MacOS
53
+ Requires-Python: >=3.10
54
+ Description-Content-Type: text/markdown
55
+ License-File: LICENSE
56
+ Requires-Dist: numpy>=1.24
57
+ Requires-Dist: matplotlib>=3.1.1
58
+ Requires-Dist: scipy>=1.3.0
59
+ Requires-Dist: pywavelets>=1.1.1
60
+ Requires-Dist: ipywidgets>=7.5.1
61
+ Requires-Dist: torch>=2.4.1
62
+ Provides-Extra: dev
63
+ Requires-Dist: pytest; extra == "dev"
64
+ Requires-Dist: pytest-cov; extra == "dev"
65
+ Provides-Extra: examples
66
+ Requires-Dist: napari[all]; extra == "examples"
67
+ Requires-Dist: jupyter; extra == "examples"
68
+
69
+ # waveorder
70
+
71
+ [![Python package index](https://img.shields.io/pypi/v/waveorder.svg)](https://pypi.org/project/waveorder)
72
+ [![PyPI monthly downloads](https://img.shields.io/pypi/dm/waveorder.svg)](https://pypistats.org/packages/waveorder)
73
+ [![Total downloads](https://pepy.tech/badge/waveorder)](https://pepy.tech/project/waveorder)
74
+ [![GitHub contributors](https://img.shields.io/github/contributors-anon/mehta-lab/waveorder)](https://github.com/mehta-lab/waveorder/graphs/contributors)
75
+ ![GitHub Repo stars](https://img.shields.io/github/stars/mehta-lab/waveorder)
76
+ ![GitHub forks](https://img.shields.io/github/forks/mehta-lab/waveorder)
77
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/waveorder)
78
+
79
+
80
+ This computational imaging library enables wave-optical simulation and reconstruction of optical properties that report microscopic architectural order.
81
+
82
+ ## Computational label-agnostic imaging
83
+
84
+ https://github.com/user-attachments/assets/4f9969e5-94ce-4e08-9f30-68314a905db6
85
+
86
+ `waveorder` enables simulations and reconstructions of label-agnostic microscopy data as described in the following [preprint](https://arxiv.org/abs/2412.09775)
87
+ <details>
88
+ <summary> Chandler et al. 2024 </summary>
89
+ <pre><code>
90
+ @article{chandler_2024,
91
+ author = {Chandler, Talon and Hirata-Miyasaki, Eduardo and Ivanov, Ivan E. and Liu, Ziwen and Sundarraman, Deepika and Ryan, Allyson Quinn and Jacobo, Adrian and Balla, Keir and Mehta, Shalin B.},
92
+ title = {waveOrder: generalist framework for label-agnostic computational microscopy},
93
+ journal = {arXiv},
94
+ year = {2024},
95
+ month = dec,
96
+ eprint = {2412.09775},
97
+ doi = {10.48550/arXiv.2412.09775}
98
+ }
99
+ </code></pre>
100
+ </details>
101
+
102
+ Specifically, `waveorder` enables simulation and reconstruction of 2D or 3D:
103
+
104
+ 1. __phase, projected retardance, and in-plane orientation__ from a polarization-diverse volumetric brightfield acquisition ([QLIPP](https://elifesciences.org/articles/55502)),
105
+
106
+ 2. __phase__ from a volumetric brightfield acquisition ([2D phase](https://www.osapublishing.org/ao/abstract.cfm?uri=ao-54-28-8566)/[3D phase](https://www.osapublishing.org/ao/abstract.cfm?uri=ao-57-1-a205)),
107
+
108
+ 3. __phase__ from an illumination-diverse volumetric acquisition ([2D](https://www.osapublishing.org/oe/fulltext.cfm?uri=oe-23-9-11394&id=315599)/[3D](https://www.osapublishing.org/boe/fulltext.cfm?uri=boe-7-10-3940&id=349951) differential phase contrast),
109
+
110
+ 4. __fluorescence density__ from a widefield volumetric fluorescence acquisition (fluorescence deconvolution).
111
+
112
+ The [examples](https://github.com/mehta-lab/waveorder/tree/main/examples) demonstrate simulations and reconstruction for 2D QLIPP, 3D PODT, 3D fluorescence deconvolution, and 2D/3D PTI methods.
113
+
114
+ If you are interested in deploying QLIPP, phase from brightfield, or fluorescence deconvolution for label-agnostic imaging at scale, checkout our [napari plugin](https://www.napari-hub.org/plugins/recOrder-napari), [`recOrder-napari`](https://github.com/mehta-lab/recOrder).
115
+
116
+ ## Permittivity tensor imaging
117
+
118
+ Additionally, `waveorder` enabled the development of a new label-free imaging method, __permittivity tensor imaging (PTI)__, that measures density and 3D orientation of biomolecules with diffraction-limited resolution. These measurements are reconstructed from polarization-resolved images acquired with a sequence of oblique illuminations.
119
+
120
+ The acquisition, calibration, background correction, reconstruction, and applications of PTI are described in the following [paper](https://doi.org/10.1101/2020.12.15.422951) published in Nature Methods:
121
+
122
+ <details>
123
+ <summary> Yeh et al. 2024 </summary>
124
+ <pre><code>
125
+ @article{yeh_2024,
126
+ author = {Yeh, Li-Hao and Ivanov, Ivan E. and Chandler, Talon and Byrum, Janie R. and Chhun, Bryant B. and Guo, Syuan-Ming and Foltz, Cameron and Hashemi, Ezzat and Perez-Bermejo, Juan A. and Wang, Huijun and Yu, Yanhao and Kazansky, Peter G. and Conklin, Bruce R. and Han, May H. and Mehta, Shalin B.},
127
+ title = {Permittivity tensor imaging: modular label-free imaging of 3D dry mass and 3D orientation at high resolution},
128
+ journal = {Nature Methods},
129
+ volume = {21},
130
+ number = {7},
131
+ pages = {1257--1274},
132
+ year = {2024},
133
+ month = jul,
134
+ issn = {1548-7105},
135
+ publisher = {Nature Publishing Group},
136
+ doi = {10.1038/s41592-024-02291-w}
137
+ }
138
+ </code></pre>
139
+ </details>
140
+
141
+ PTI provides volumetric reconstructions of mean permittivity ($\propto$ material density), differential permittivity ($\propto$ material anisotropy), 3D orientation, and optic sign. The following figure summarizes PTI acquisition and reconstruction with a small optical section of the mouse brain tissue:
142
+
143
+ ![Data_flow](https://github.com/mehta-lab/waveorder/blob/main/readme.png?raw=true)
144
+
145
+ ## Examples
146
+ The [examples](https://github.com/mehta-lab/waveorder/tree/main/examples) illustrate simulations and reconstruction for 2D QLIPP, 3D phase from brightfield, and 2D/3D PTI methods.
147
+
148
+ If you are interested in deploying QLIPP or phase from brightbrield, or fluorescence deconvolution for label-agnostic imaging at scale, checkout our [napari plugin](https://www.napari-hub.org/plugins/recOrder-napari), [`recOrder-napari`](https://github.com/mehta-lab/recOrder).
149
+
150
+ ## Citation
151
+
152
+ Please cite this repository, along with the relevant preprint or paper, if you use or adapt this code. The citation information can be found by clicking "Cite this repository" button in the About section in the right sidebar.
153
+
154
+ ## Installation
155
+
156
+ Create a virtual environment:
157
+
158
+ ```sh
159
+ conda create -y -n waveorder python=3.10
160
+ conda activate waveorder
161
+ ```
162
+
163
+ Install `waveorder` from PyPI:
164
+
165
+ ```sh
166
+ pip install waveorder
167
+ ```
168
+
169
+ Use `waveorder` in your scripts:
170
+
171
+ ```sh
172
+ python
173
+ >>> import waveorder
174
+ ```
175
+
176
+ (Optional) Install example dependencies, clone the repository, and run an example script:
177
+ ```sh
178
+ pip install waveorder[examples]
179
+ git clone https://github.com/mehta-lab/waveorder.git
180
+ python waveorder/examples/models/phase_thick_3d.py
181
+ ```
182
+
183
+ (M1 users) `pytorch` has [incomplete GPU support](https://github.com/pytorch/pytorch/issues/77764),
184
+ so please use `export PYTORCH_ENABLE_MPS_FALLBACK=1`
185
+ to allow some operators to fallback to CPU
186
+ if you plan to use GPU acceleration for polarization reconstruction.
@@ -0,0 +1,118 @@
1
+ # waveorder
2
+
3
+ [![Python package index](https://img.shields.io/pypi/v/waveorder.svg)](https://pypi.org/project/waveorder)
4
+ [![PyPI monthly downloads](https://img.shields.io/pypi/dm/waveorder.svg)](https://pypistats.org/packages/waveorder)
5
+ [![Total downloads](https://pepy.tech/badge/waveorder)](https://pepy.tech/project/waveorder)
6
+ [![GitHub contributors](https://img.shields.io/github/contributors-anon/mehta-lab/waveorder)](https://github.com/mehta-lab/waveorder/graphs/contributors)
7
+ ![GitHub Repo stars](https://img.shields.io/github/stars/mehta-lab/waveorder)
8
+ ![GitHub forks](https://img.shields.io/github/forks/mehta-lab/waveorder)
9
+ ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/waveorder)
10
+
11
+
12
+ This computational imaging library enables wave-optical simulation and reconstruction of optical properties that report microscopic architectural order.
13
+
14
+ ## Computational label-agnostic imaging
15
+
16
+ https://github.com/user-attachments/assets/4f9969e5-94ce-4e08-9f30-68314a905db6
17
+
18
+ `waveorder` enables simulations and reconstructions of label-agnostic microscopy data as described in the following [preprint](https://arxiv.org/abs/2412.09775)
19
+ <details>
20
+ <summary> Chandler et al. 2024 </summary>
21
+ <pre><code>
22
+ @article{chandler_2024,
23
+ author = {Chandler, Talon and Hirata-Miyasaki, Eduardo and Ivanov, Ivan E. and Liu, Ziwen and Sundarraman, Deepika and Ryan, Allyson Quinn and Jacobo, Adrian and Balla, Keir and Mehta, Shalin B.},
24
+ title = {waveOrder: generalist framework for label-agnostic computational microscopy},
25
+ journal = {arXiv},
26
+ year = {2024},
27
+ month = dec,
28
+ eprint = {2412.09775},
29
+ doi = {10.48550/arXiv.2412.09775}
30
+ }
31
+ </code></pre>
32
+ </details>
33
+
34
+ Specifically, `waveorder` enables simulation and reconstruction of 2D or 3D:
35
+
36
+ 1. __phase, projected retardance, and in-plane orientation__ from a polarization-diverse volumetric brightfield acquisition ([QLIPP](https://elifesciences.org/articles/55502)),
37
+
38
+ 2. __phase__ from a volumetric brightfield acquisition ([2D phase](https://www.osapublishing.org/ao/abstract.cfm?uri=ao-54-28-8566)/[3D phase](https://www.osapublishing.org/ao/abstract.cfm?uri=ao-57-1-a205)),
39
+
40
+ 3. __phase__ from an illumination-diverse volumetric acquisition ([2D](https://www.osapublishing.org/oe/fulltext.cfm?uri=oe-23-9-11394&id=315599)/[3D](https://www.osapublishing.org/boe/fulltext.cfm?uri=boe-7-10-3940&id=349951) differential phase contrast),
41
+
42
+ 4. __fluorescence density__ from a widefield volumetric fluorescence acquisition (fluorescence deconvolution).
43
+
44
+ The [examples](https://github.com/mehta-lab/waveorder/tree/main/examples) demonstrate simulations and reconstruction for 2D QLIPP, 3D PODT, 3D fluorescence deconvolution, and 2D/3D PTI methods.
45
+
46
+ If you are interested in deploying QLIPP, phase from brightfield, or fluorescence deconvolution for label-agnostic imaging at scale, checkout our [napari plugin](https://www.napari-hub.org/plugins/recOrder-napari), [`recOrder-napari`](https://github.com/mehta-lab/recOrder).
47
+
48
+ ## Permittivity tensor imaging
49
+
50
+ Additionally, `waveorder` enabled the development of a new label-free imaging method, __permittivity tensor imaging (PTI)__, that measures density and 3D orientation of biomolecules with diffraction-limited resolution. These measurements are reconstructed from polarization-resolved images acquired with a sequence of oblique illuminations.
51
+
52
+ The acquisition, calibration, background correction, reconstruction, and applications of PTI are described in the following [paper](https://doi.org/10.1101/2020.12.15.422951) published in Nature Methods:
53
+
54
+ <details>
55
+ <summary> Yeh et al. 2024 </summary>
56
+ <pre><code>
57
+ @article{yeh_2024,
58
+ author = {Yeh, Li-Hao and Ivanov, Ivan E. and Chandler, Talon and Byrum, Janie R. and Chhun, Bryant B. and Guo, Syuan-Ming and Foltz, Cameron and Hashemi, Ezzat and Perez-Bermejo, Juan A. and Wang, Huijun and Yu, Yanhao and Kazansky, Peter G. and Conklin, Bruce R. and Han, May H. and Mehta, Shalin B.},
59
+ title = {Permittivity tensor imaging: modular label-free imaging of 3D dry mass and 3D orientation at high resolution},
60
+ journal = {Nature Methods},
61
+ volume = {21},
62
+ number = {7},
63
+ pages = {1257--1274},
64
+ year = {2024},
65
+ month = jul,
66
+ issn = {1548-7105},
67
+ publisher = {Nature Publishing Group},
68
+ doi = {10.1038/s41592-024-02291-w}
69
+ }
70
+ </code></pre>
71
+ </details>
72
+
73
+ PTI provides volumetric reconstructions of mean permittivity ($\propto$ material density), differential permittivity ($\propto$ material anisotropy), 3D orientation, and optic sign. The following figure summarizes PTI acquisition and reconstruction with a small optical section of the mouse brain tissue:
74
+
75
+ ![Data_flow](https://github.com/mehta-lab/waveorder/blob/main/readme.png?raw=true)
76
+
77
+ ## Examples
78
+ The [examples](https://github.com/mehta-lab/waveorder/tree/main/examples) illustrate simulations and reconstruction for 2D QLIPP, 3D phase from brightfield, and 2D/3D PTI methods.
79
+
80
+ If you are interested in deploying QLIPP or phase from brightbrield, or fluorescence deconvolution for label-agnostic imaging at scale, checkout our [napari plugin](https://www.napari-hub.org/plugins/recOrder-napari), [`recOrder-napari`](https://github.com/mehta-lab/recOrder).
81
+
82
+ ## Citation
83
+
84
+ Please cite this repository, along with the relevant preprint or paper, if you use or adapt this code. The citation information can be found by clicking "Cite this repository" button in the About section in the right sidebar.
85
+
86
+ ## Installation
87
+
88
+ Create a virtual environment:
89
+
90
+ ```sh
91
+ conda create -y -n waveorder python=3.10
92
+ conda activate waveorder
93
+ ```
94
+
95
+ Install `waveorder` from PyPI:
96
+
97
+ ```sh
98
+ pip install waveorder
99
+ ```
100
+
101
+ Use `waveorder` in your scripts:
102
+
103
+ ```sh
104
+ python
105
+ >>> import waveorder
106
+ ```
107
+
108
+ (Optional) Install example dependencies, clone the repository, and run an example script:
109
+ ```sh
110
+ pip install waveorder[examples]
111
+ git clone https://github.com/mehta-lab/waveorder.git
112
+ python waveorder/examples/models/phase_thick_3d.py
113
+ ```
114
+
115
+ (M1 users) `pytorch` has [incomplete GPU support](https://github.com/pytorch/pytorch/issues/77764),
116
+ so please use `export PYTORCH_ENABLE_MPS_FALLBACK=1`
117
+ to allow some operators to fallback to CPU
118
+ if you plan to use GPU acceleration for polarization reconstruction.
@@ -0,0 +1,10 @@
1
+ `waveorder` is undergoing a significant refactor, and this `examples/` folder serves as a good place to understand the current state of the repository.
2
+
3
+ Some examples require `pip install waveorder[examples]` for `napari` and `jupyter`. Visit the [napari installation guide](https://napari.org/dev/tutorials/fundamentals/installation.html) if napari installation fails.
4
+
5
+ | Folder | Requires | Description |
6
+ |------------------|----------------------------|-------------------------------------------------------------------------------------------------------|
7
+ | `models/` | `pip install waveorder[examples]` | Demonstrates the latest functionality of `waveorder` through simulations and reconstructions using various models. |
8
+ | `maintenance/` | `pip install waveorder` | Examples of computational imaging methods enabled by functionality of waveorder; scripts are maintained with automated tests. |
9
+ | `visuals/` | `pip install waveorder[examples]` | Visualizations of transfer functions and Green's tensors. |
10
+ | `documentation/` | `pip install waveorder`, complete datasets | Provides examples of real-data reconstructions; serves as documentation and is not actively maintained. |
@@ -6,11 +6,12 @@ import matplotlib.pyplot as plt
6
6
  from numpy.fft import fftshift
7
7
 
8
8
  import waveorder as wo
9
- from waveorder import optics, waveorder_reconstructor, util, visual
9
+ from waveorder import optics, waveorder_reconstructor, util
10
10
 
11
11
  import zarr
12
12
  from pathlib import Path
13
13
  from iohub import open_ome_zarr
14
+ from waveorder.visuals import jupyter_visuals
14
15
 
15
16
  # %%
16
17
  # Initialization
@@ -110,7 +111,7 @@ for i in range(len(Source)):
110
111
  Source_PolState[i, 1] = E_in[1]
111
112
 
112
113
 
113
- visual.plot_multicolumn(
114
+ jupyter_visuals.plot_multicolumn(
114
115
  fftshift(Source, axes=(1, 2)), origin="lower", num_col=5
115
116
  )
116
117
 
@@ -162,7 +163,7 @@ S_image_tm[2] = (
162
163
 
163
164
  # %%
164
165
  # browse raw intensity stacks (stack_idx_1: z index, stack_idx2: pattern index)
165
- visual.parallel_5D_viewer(
166
+ jupyter_visuals.parallel_5D_viewer(
166
167
  np.transpose(I_meas[:, :, :, :, ::-1], (4, 1, 0, 2, 3)),
167
168
  num_col=4,
168
169
  size=10,
@@ -171,7 +172,7 @@ visual.parallel_5D_viewer(
171
172
 
172
173
  # %%
173
174
  # browse uncorrected Stokes parameters (stack_idx_1: z index, stack_idx2: pattern index)
174
- visual.parallel_5D_viewer(
175
+ jupyter_visuals.parallel_5D_viewer(
175
176
  np.transpose(S_image_recon, (4, 1, 0, 2, 3)),
176
177
  num_col=3,
177
178
  size=8,
@@ -182,7 +183,7 @@ visual.parallel_5D_viewer(
182
183
 
183
184
  # %%
184
185
  # browse corrected Stokes parameters (stack_idx_1: z index, stack_idx2: pattern index)
185
- visual.parallel_5D_viewer(
186
+ jupyter_visuals.parallel_5D_viewer(
186
187
  np.transpose(S_image_tm, (4, 1, 0, 2, 3)),
187
188
  num_col=3,
188
189
  size=8,
@@ -213,7 +214,7 @@ f_tensor = setup.scattering_potential_tensor_recon_3D_vec(
213
214
 
214
215
  # %%
215
216
  # browse the z-stack of components of scattering potential tensor
216
- visual.parallel_4D_viewer(
217
+ jupyter_visuals.parallel_4D_viewer(
217
218
  np.transpose(f_tensor, (3, 0, 1, 2)),
218
219
  num_col=4,
219
220
  origin="lower",
@@ -278,7 +279,7 @@ differential_permittivity_PT = np.array(
278
279
 
279
280
  # %%
280
281
  # browse the reconstructed physical properties
281
- visual.parallel_4D_viewer(
282
+ jupyter_visuals.parallel_4D_viewer(
282
283
  np.transpose(
283
284
  np.stack(
284
285
  [
@@ -546,7 +547,7 @@ ax[5, 1].set_title("inclination (+) (xz)")
546
547
 
547
548
  # %%
548
549
  # browse XY planes of the phase and differential permittivity
549
- visual.parallel_4D_viewer(
550
+ jupyter_visuals.parallel_4D_viewer(
550
551
  np.transpose(
551
552
  [
552
553
  np.clip(phase_PT, phase_min, phase_max),
@@ -585,7 +586,7 @@ orientation_3D_image = np.transpose(
585
586
  ),
586
587
  (3, 1, 2, 0),
587
588
  )
588
- orientation_3D_image_RGB = visual.orientation_3D_to_rgb(
589
+ orientation_3D_image_RGB = jupyter_visuals.orientation_3D_to_rgb(
589
590
  orientation_3D_image, interp_belt=20 / 180 * np.pi, sat_factor=1
590
591
  )
591
592
 
@@ -600,7 +601,7 @@ plt.imshow(
600
601
 
601
602
  # plot the top view of 3D orientation colorsphere
602
603
  plt.figure(figsize=(3, 3))
603
- visual.orientation_3D_colorwheel(
604
+ jupyter_visuals.orientation_3D_colorwheel(
604
605
  wheelsize=256, circ_size=50, interp_belt=20 / 180 * np.pi, sat_factor=1
605
606
  )
606
607
 
@@ -639,7 +640,7 @@ plt.imshow(
639
640
  in_plane_orientation[:, y_layer], origin="lower", aspect=z_step / ps
640
641
  )
641
642
  plt.figure(figsize=(3, 3))
642
- visual.orientation_2D_colorwheel()
643
+ jupyter_visuals.orientation_2D_colorwheel()
643
644
 
644
645
  # %%
645
646
  # out-of-plane tilt
@@ -686,7 +687,7 @@ z_layer = 44
686
687
 
687
688
  fig, ax = plt.subplots(1, 1, figsize=(15, 15))
688
689
 
689
- visual.plot3DVectorField(
690
+ jupyter_visuals.plot3DVectorField(
690
691
  np.abs(differential_permittivity_PT[1, :, :, z_layer]),
691
692
  azimuth[1, :, :, z_layer],
692
693
  theta[1, :, :, z_layer],
@@ -722,7 +723,7 @@ plt.imshow(
722
723
  # %%
723
724
  # Angular histogram of 3D orientation
724
725
 
725
- visual.orientation_3D_hist(
726
+ jupyter_visuals.orientation_3D_hist(
726
727
  azimuth[1].flatten(),
727
728
  theta[1].flatten(),
728
729
  ret_mask.flatten(),
@@ -15,9 +15,9 @@ from numpy.fft import fftshift
15
15
  from waveorder import (
16
16
  optics,
17
17
  waveorder_simulator,
18
- visual,
19
18
  util,
20
19
  )
20
+ from waveorder.visuals import jupyter_visuals
21
21
 
22
22
  #####################################################################
23
23
  # Initialization - imaging system and sample #
@@ -145,7 +145,7 @@ biref_map = ne_map_copy - no_map_copy
145
145
  ### Visualize sample properties
146
146
 
147
147
  #### XY sections
148
- visual.plot_multicolumn(
148
+ jupyter_visuals.plot_multicolumn(
149
149
  [
150
150
  target[:, :, z_layer],
151
151
  azimuth[:, :, z_layer] % (2 * np.pi),
@@ -158,7 +158,7 @@ visual.plot_multicolumn(
158
158
  set_title=True,
159
159
  )
160
160
  #### XZ sections
161
- visual.plot_multicolumn(
161
+ jupyter_visuals.plot_multicolumn(
162
162
  [
163
163
  np.transpose(target[y_layer, :, :]),
164
164
  np.transpose(azimuth[y_layer, :, :]) % (2 * np.pi),
@@ -197,7 +197,7 @@ orientation_3D_image = np.transpose(
197
197
  ),
198
198
  (3, 1, 2, 0),
199
199
  )
200
- orientation_3D_image_RGB = visual.orientation_3D_to_rgb(
200
+ orientation_3D_image_RGB = jupyter_visuals.orientation_3D_to_rgb(
201
201
  orientation_3D_image, interp_belt=20 / 180 * np.pi, sat_factor=1
202
202
  )
203
203
 
@@ -206,7 +206,7 @@ plt.imshow(orientation_3D_image_RGB[z_layer], origin="lower")
206
206
  plt.figure(figsize=(10, 10))
207
207
  plt.imshow(orientation_3D_image_RGB[:, y_layer], origin="lower")
208
208
  plt.figure(figsize=(3, 3))
209
- visual.orientation_3D_colorwheel(
209
+ jupyter_visuals.orientation_3D_colorwheel(
210
210
  wheelsize=128,
211
211
  circ_size=50,
212
212
  interp_belt=20 / 180 * np.pi,
@@ -216,7 +216,7 @@ visual.orientation_3D_colorwheel(
216
216
  plt.show()
217
217
 
218
218
  #### Angular histogram of 3D orientation
219
- visual.orientation_3D_hist(
219
+ jupyter_visuals.orientation_3D_hist(
220
220
  azimuth.flatten(),
221
221
  inclination.flatten(),
222
222
  np.abs(target).flatten(),
@@ -258,7 +258,7 @@ epsilon_tensor[2, 1] = epsilon_del * np.sin(2 * inclination) * np.sin(azimuth)
258
258
  epsilon_tensor[2, 2] = epsilon_mean + epsilon_del * np.cos(2 * inclination)
259
259
 
260
260
 
261
- visual.plot_multicolumn(
261
+ jupyter_visuals.plot_multicolumn(
262
262
  [
263
263
  epsilon_tensor[0, 0, :, :, z_layer],
264
264
  epsilon_tensor[0, 1, :, :, z_layer],
@@ -334,7 +334,7 @@ del_f_component[6] = (
334
334
  )
335
335
 
336
336
 
337
- visual.plot_multicolumn(
337
+ jupyter_visuals.plot_multicolumn(
338
338
  [
339
339
  del_f_component[0, :, :, z_layer],
340
340
  del_f_component[1, :, :, z_layer],
@@ -425,11 +425,11 @@ for i in range(len(Source)):
425
425
 
426
426
  #### Circularly polarized illumination patterns
427
427
 
428
- visual.plot_multicolumn(
428
+ jupyter_visuals.plot_multicolumn(
429
429
  fftshift(Source_cont, axes=(1, 2)), origin="lower", num_col=5, size=5
430
430
  )
431
431
  # discretized illumination patterns used in simulation (faster forward model)
432
- visual.plot_multicolumn(
432
+ jupyter_visuals.plot_multicolumn(
433
433
  fftshift(Source, axes=(1, 2)), origin="lower", num_col=5, size=5
434
434
  )
435
435
  print(Source_PolState)
@@ -16,8 +16,8 @@ from numpy.fft import fftshift
16
16
  from waveorder import (
17
17
  optics,
18
18
  waveorder_reconstructor,
19
- visual,
20
19
  )
20
+ from waveorder.visuals import jupyter_visuals
21
21
 
22
22
  ## Initialization
23
23
  ## Load simulated images and parameters
@@ -76,7 +76,7 @@ setup = waveorder_reconstructor.waveorder_microscopy(
76
76
  ## Visualize 2 D transfer functions as a function of illumination pattern
77
77
 
78
78
  # illumination patterns used
79
- visual.plot_multicolumn(
79
+ jupyter_visuals.plot_multicolumn(
80
80
  fftshift(Source_cont, axes=(1, 2)), origin="lower", num_col=5, size=5
81
81
  )
82
82
  plt.show()
@@ -118,7 +118,7 @@ f_tensor = setup.scattering_potential_tensor_recon_2D_vec(
118
118
  S_image_tm, reg_inc=reg_inc, cupy_det=True
119
119
  )
120
120
 
121
- visual.plot_multicolumn(
121
+ jupyter_visuals.plot_multicolumn(
122
122
  f_tensor,
123
123
  num_col=4,
124
124
  origin="lower",
@@ -255,14 +255,14 @@ orientation_3D_image = np.transpose(
255
255
  ),
256
256
  (1, 2, 0),
257
257
  )
258
- orientation_3D_image_RGB = visual.orientation_3D_to_rgb(
258
+ orientation_3D_image_RGB = jupyter_visuals.orientation_3D_to_rgb(
259
259
  orientation_3D_image, interp_belt=20 / 180 * np.pi, sat_factor=1
260
260
  )
261
261
 
262
262
  plt.figure(figsize=(5, 5))
263
263
  plt.imshow(orientation_3D_image_RGB, origin="lower")
264
264
  plt.figure(figsize=(3, 3))
265
- visual.orientation_3D_colorwheel(
265
+ jupyter_visuals.orientation_3D_colorwheel(
266
266
  wheelsize=256, circ_size=50, interp_belt=20 / 180 * np.pi, sat_factor=1
267
267
  )
268
268
  plt.show()
@@ -297,7 +297,7 @@ in_plane_orientation = hsv_to_rgb(I_hsv.copy())
297
297
  plt.figure(figsize=(5, 5))
298
298
  plt.imshow(in_plane_orientation, origin="lower")
299
299
  plt.figure(figsize=(3, 3))
300
- visual.orientation_2D_colorwheel()
300
+ jupyter_visuals.orientation_2D_colorwheel()
301
301
  plt.show()
302
302
 
303
303
  # out-of-plane tilt
@@ -339,7 +339,7 @@ spacing = 4
339
339
  plt.figure(figsize=(10, 10))
340
340
 
341
341
  fig, ax = plt.subplots(1, 1, figsize=(20, 10))
342
- visual.plot3DVectorField(
342
+ jupyter_visuals.plot3DVectorField(
343
343
  np.abs(retardance_pr_nm[0]),
344
344
  azimuth[0],
345
345
  theta[0],
@@ -362,7 +362,7 @@ ret_mask[ret_mask < 0.5] = 0
362
362
 
363
363
  plt.figure(figsize=(10, 10))
364
364
  plt.imshow(ret_mask, cmap="gray", origin="lower")
365
- visual.orientation_3D_hist(
365
+ jupyter_visuals.orientation_3D_hist(
366
366
  azimuth[0].flatten(),
367
367
  theta[0].flatten(),
368
368
  ret_mask.flatten(),