faser 0.3.2__tar.gz → 0.3.4__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.
- faser-0.3.4/PKG-INFO +156 -0
- faser-0.3.4/README.md +132 -0
- faser-0.3.4/psf.tif +0 -0
- faser-0.3.4/psf_config.json +55 -0
- {faser-0.3.2 → faser-0.3.4}/pyproject.toml +3 -1
- {faser-0.3.2 → faser-0.3.4}/src/faser/napari/widgets/export.py +5 -5
- {faser-0.3.2 → faser-0.3.4}/src/faser/napari/widgets/fields.py +10 -10
- {faser-0.3.2 → faser-0.3.4}/src/faser/napari/widgets/helper_widget.py +14 -14
- {faser-0.3.2 → faser-0.3.4}/src/faser/napari/widgets/main_widget.py +1 -2
- {faser-0.3.2 → faser-0.3.4}/src/faser/napari/widgets/mpl_canvas.py +4 -4
- {faser-0.3.2 → faser-0.3.4}/src/faser/napari/widgets/tob_bar.py +5 -8
- {faser-0.3.2 → faser-0.3.4}/uv.lock +9 -5
- faser-0.3.4/website/.gitignore +21 -0
- faser-0.3.4/website/.vscode/extensions.json +4 -0
- faser-0.3.4/website/.vscode/launch.json +11 -0
- faser-0.3.4/website/README.md +54 -0
- faser-0.3.4/website/astro.config.mjs +36 -0
- faser-0.3.4/website/package-lock.json +9012 -0
- faser-0.3.4/website/package.json +20 -0
- faser-0.3.4/website/public/favicon.svg +1 -0
- faser-0.3.4/website/src/assets/houston.webp +0 -0
- faser-0.3.4/website/src/content/docs/guides/introduction.md +14 -0
- faser-0.3.4/website/src/content/docs/index.mdx +36 -0
- faser-0.3.4/website/src/content/docs/reference/example.md +11 -0
- faser-0.3.4/website/src/content.config.ts +7 -0
- faser-0.3.4/website/src/tailwind.css +3 -0
- faser-0.3.4/website/tailwind.config.mjs +11 -0
- faser-0.3.4/website/tsconfig.json +5 -0
- faser-0.3.2/PKG-INFO +0 -25
- faser-0.3.2/README.md +0 -3
- {faser-0.3.2 → faser-0.3.4}/.github/workflows/publish.yml +0 -0
- {faser-0.3.2 → faser-0.3.4}/.github/workflows/test.yml +0 -0
- {faser-0.3.2 → faser-0.3.4}/.gitignore +0 -0
- {faser-0.3.2 → faser-0.3.4}/.vscode/launch.json +0 -0
- {faser-0.3.2 → faser-0.3.4}/.vscode/settings.json +0 -0
- {faser-0.3.2 → faser-0.3.4}/.vscode/tasks.json +0 -0
- {faser-0.3.2 → faser-0.3.4}/nap.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/__init__.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/assets/Figure_ab.png +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/assets/Figure_beam.png +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/assets/Figure_geom.png +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/assets/Figure_simu.png +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/assets/batch.png +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/assets/load.png +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/assets/placeholder.png +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/assets/refresh.png +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/assets/save.png +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/assets/single.png +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/cli/__init__.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/cli/main.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/cli/qtmain.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/env.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/__init__.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/base.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/scalar/__init__.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/scalar/gibson_lanny/PSFGenerator.jar +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/scalar/gibson_lanny/__init__.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/scalar/gibson_lanny/config.txt +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/scalar/gibson_lanny/gen.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/scalar/phasenet/__init__.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/scalar/phasenet/generator.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/scalar/phasenet/wavefront.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/utils.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/vectorial/__init__.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/vectorial/stephane/__init__.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/vectorial/stephane/april_version.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/vectorial/stephane/tilted_compiled.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/vectorial/stephane/tilted_coverslip.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/generators/vectorial/utils.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/io.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/napari/__init__.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/napari/gui.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/napari/main.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/faser/napari.yaml +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/tests/psf/config.txt +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/tests/psf/psf.tif +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/tests/test_cli.py +0 -0
- {faser-0.3.2 → faser-0.3.4}/src/tests/test_random.py +0 -0
faser-0.3.4/PKG-INFO
ADDED
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: faser
|
|
3
|
+
Version: 0.3.4
|
|
4
|
+
Summary: Faser is a tool for vectorial psf simulation
|
|
5
|
+
Author-email: Johannes Roos <jhnnsrs@gmail.com>
|
|
6
|
+
Classifier: Framework :: napari
|
|
7
|
+
Requires-Python: <3.13,>=3.9
|
|
8
|
+
Requires-Dist: matplotlib>=3.9.2
|
|
9
|
+
Requires-Dist: numpy<2
|
|
10
|
+
Requires-Dist: psygnal>=0.11.1
|
|
11
|
+
Requires-Dist: pydantic>2
|
|
12
|
+
Requires-Dist: python-slugify>=8.0.4
|
|
13
|
+
Requires-Dist: qtpy>=2.4.2
|
|
14
|
+
Requires-Dist: superqt>=0.6.7
|
|
15
|
+
Requires-Dist: tifffile>=2024.8.30
|
|
16
|
+
Provides-Extra: cli
|
|
17
|
+
Requires-Dist: rich-click>=1.8.3; extra == 'cli'
|
|
18
|
+
Provides-Extra: full
|
|
19
|
+
Requires-Dist: pyqt5>=5.15.11; extra == 'full'
|
|
20
|
+
Requires-Dist: rich-click>=1.8.3; extra == 'full'
|
|
21
|
+
Provides-Extra: numba
|
|
22
|
+
Requires-Dist: numba>=0.60.0; extra == 'numba'
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
|
|
25
|
+
# faser
|
|
26
|
+
|
|
27
|
+
faser is a Python-based software package designed to simulate the excitation
|
|
28
|
+
point spread function (PSF) of optical microscopes. Faser calculates PSFs for high NA
|
|
29
|
+
focusing by using a vectorial model of the electromagnetic field, enabling exploration of the impact
|
|
30
|
+
of geometrical and optical parameters on imaging performance in advanced applications. The
|
|
31
|
+
software supports various beam profiles, including those used in STED microscopy, and allows for
|
|
32
|
+
the simulation of common experimental conditions such as a cranial window and a coverslip tilt.
|
|
33
|
+
|
|
34
|
+
We provide to prefered ways to use faser:
|
|
35
|
+
|
|
36
|
+
## Faser as a Napari Plugin
|
|
37
|
+
|
|
38
|
+
The recommended way to install faser is as a Napari plugin, which provides a user-friendly GUI for interactively exploring the PSF simulation. This can be done via:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install faser napari[pyqt5]
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
#### Usage
|
|
45
|
+
|
|
46
|
+
You can run the GUI application via (or just as a Napari plugin)
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
qtfaser
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
For more information on how to use the GUI, please refer to the [preprint](https://faser.readthedocs.io/en/latest/).
|
|
53
|
+
|
|
54
|
+
## Faser as a standalone application
|
|
55
|
+
|
|
56
|
+
Alternatively, you can install the package as a standalone application only, that you can run in enironments without Napari or GUI support:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install faser[cli]
|
|
60
|
+
```
|
|
61
|
+
This will install the package as a standalone application that can be run from the command line via:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
faser
|
|
65
|
+
```
|
|
66
|
+
We generally recommend the GUI application for most users, as it provides a more user-friendly interface.
|
|
67
|
+
However faser can also be used as a library, and the CLI application is useful for scripting and batch processing.
|
|
68
|
+
|
|
69
|
+
#### Usage
|
|
70
|
+
|
|
71
|
+
To simulate the PSF, with a specific numerical aperture (NA) and a beam profile, you can run the following command:
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
faser --na 1.4 --window=NO
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
For more information and options you can run:
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
faser --help
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
To display the GUI interface and the available options:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
__
|
|
87
|
+
/ _| __ _ ___ ___ _ __
|
|
88
|
+
| |_ / _` / __|/ _ \ '__|
|
|
89
|
+
| _| (_| \__ \ __/ |
|
|
90
|
+
|_| \__,_|___/\___|_|
|
|
91
|
+
|
|
92
|
+
Generating PSF with config
|
|
93
|
+
faser➜ faser git:(master) ✗ uv run faser --help
|
|
94
|
+
|
|
95
|
+
Usage: faser [OPTIONS]
|
|
96
|
+
|
|
97
|
+
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
98
|
+
│ --config FILENAME Path to a JSON file │
|
|
99
|
+
│ --detector_gaussian_noise FLOAT Detector Gaussian noise │
|
|
100
|
+
│ --gaussian_beam_noise FLOAT Gaussian_beam noise │
|
|
101
|
+
│ --add_noise NOISE │
|
|
102
|
+
│ --loaded_phase_mask OPTIONAL Loaded Phasemak │
|
|
103
|
+
│ --p FLOAT Ratio between Donut (p) and Bottle (1-p) intensity │
|
|
104
|
+
│ --mask_offset_y FLOAT Y offset of the phase mask in regard to pupil center │
|
|
105
|
+
│ --mask_offset_x FLOAT X offset of the phase mask in regard to pupil center │
|
|
106
|
+
│ --ring_radius FLOAT Radius of the ring phase mask (on unit pupil) │
|
|
107
|
+
│ --rc FLOAT Ring charge (should be odd to produce bottle) │
|
|
108
|
+
│ --vc FLOAT Vortex charge (should be integer to produce donut) │
|
|
109
|
+
│ --epsilon FLOAT Ellipticity of the polarization (in °) │
|
|
110
|
+
│ --psi FLOAT Direction of the polarization (in °) │
|
|
111
|
+
│ --ampl_offset_y FLOAT Y offset of the amplitude profile in regard to pupil center │
|
|
112
|
+
│ --ampl_offset_x FLOAT X offset of the amplitude profile in regard to pupil center │
|
|
113
|
+
│ --waist FLOAT Diameter of the input beam on the objective pupil (in µm) │
|
|
114
|
+
│ --wavelength FLOAT Wavelength of light (in µm) │
|
|
115
|
+
│ --polarization POLARIZATION │
|
|
116
|
+
│ --mode MODE │
|
|
117
|
+
│ --aberration_offset_y FLOAT Y offset of the aberration function in regard to pupil center │
|
|
118
|
+
│ --aberration_offset_x FLOAT X offset of the aberration function in regard to pupil center │
|
|
119
|
+
│ --a24 ABERRATIONFLOAT Secondary spherical │
|
|
120
|
+
│ --a12 ABERRATIONFLOAT Primary spherical │
|
|
121
|
+
│ --a9 ABERRATIONFLOAT Oblique Trefoil │
|
|
122
|
+
│ --a8 ABERRATIONFLOAT Horizontal Coma │
|
|
123
|
+
│ --a7 ABERRATIONFLOAT Vertical Coma │
|
|
124
|
+
│ --a6 ABERRATIONFLOAT Vertical Trefoil │
|
|
125
|
+
│ --a5 ABERRATIONFLOAT Vertical Astigmatism │
|
|
126
|
+
│ --a4 ABERRATIONFLOAT Defocus │
|
|
127
|
+
│ --a3 ABERRATIONFLOAT Oblique Astigmatism │
|
|
128
|
+
│ --a2 ABERRATIONFLOAT Horizontal Tilt │
|
|
129
|
+
│ --a1 ABERRATIONFLOAT Vertical Tilt │
|
|
130
|
+
│ --a0 ABERRATIONFLOAT Piston │
|
|
131
|
+
│ --wind_offset_y FLOAT Y offset of the cranial window in regard to pupil center │
|
|
132
|
+
│ --wind_offset_x FLOAT X offset of the cranial window in regard to pupil center │
|
|
133
|
+
│ --wind_depth FLOAT Depth of the cranial window (in mm) │
|
|
134
|
+
│ --wind_radius FLOAT Diameter of the cranial window (in mm) │
|
|
135
|
+
│ --window WINDOW │
|
|
136
|
+
│ --tilt FLOAT Tilt angle of the coverslip (in °) │
|
|
137
|
+
│ --depth FLOAT Imaging depth in the sample (in µm) │
|
|
138
|
+
│ --collar FLOAT Correction collar setting to compensate coverslip thickness │
|
|
139
|
+
│ --thickness FLOAT Thickness of the coverslip (in µm) │
|
|
140
|
+
│ --n3 FLOAT Refractive index of the sample │
|
|
141
|
+
│ --n2 FLOAT Refractive index of the coverslip │
|
|
142
|
+
│ --n1 FLOAT Refractive index of the immersion medium │
|
|
143
|
+
│ --wd FLOAT Working Distance of the objective lens (in µm) │
|
|
144
|
+
│ --na FLOAT Numerical Aperture of Objective Lens │
|
|
145
|
+
│ --normalize NORMALIZE │
|
|
146
|
+
│ --nphi INTEGER Integration sted of the aximutal angle on the pupil │
|
|
147
|
+
│ --ntheta INTEGER Integration sted of the focalization angle │
|
|
148
|
+
│ --nz INTEGER Discretization of Z axis - better be odd number for perfect 0 │
|
|
149
|
+
│ --nxy INTEGER Discretization of image plane - better be odd number for perfect 0 │
|
|
150
|
+
│ --l_obs_z FLOAT Observation scale in Z (in µm) │
|
|
151
|
+
│ --l_obs_xy FLOAT Observation scale in XY (in µm) │
|
|
152
|
+
│ --help Show this message and exit. │
|
|
153
|
+
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
|
faser-0.3.4/README.md
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# faser
|
|
2
|
+
|
|
3
|
+
faser is a Python-based software package designed to simulate the excitation
|
|
4
|
+
point spread function (PSF) of optical microscopes. Faser calculates PSFs for high NA
|
|
5
|
+
focusing by using a vectorial model of the electromagnetic field, enabling exploration of the impact
|
|
6
|
+
of geometrical and optical parameters on imaging performance in advanced applications. The
|
|
7
|
+
software supports various beam profiles, including those used in STED microscopy, and allows for
|
|
8
|
+
the simulation of common experimental conditions such as a cranial window and a coverslip tilt.
|
|
9
|
+
|
|
10
|
+
We provide to prefered ways to use faser:
|
|
11
|
+
|
|
12
|
+
## Faser as a Napari Plugin
|
|
13
|
+
|
|
14
|
+
The recommended way to install faser is as a Napari plugin, which provides a user-friendly GUI for interactively exploring the PSF simulation. This can be done via:
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install faser napari[pyqt5]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
#### Usage
|
|
21
|
+
|
|
22
|
+
You can run the GUI application via (or just as a Napari plugin)
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
qtfaser
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
For more information on how to use the GUI, please refer to the [preprint](https://faser.readthedocs.io/en/latest/).
|
|
29
|
+
|
|
30
|
+
## Faser as a standalone application
|
|
31
|
+
|
|
32
|
+
Alternatively, you can install the package as a standalone application only, that you can run in enironments without Napari or GUI support:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
pip install faser[cli]
|
|
36
|
+
```
|
|
37
|
+
This will install the package as a standalone application that can be run from the command line via:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
faser
|
|
41
|
+
```
|
|
42
|
+
We generally recommend the GUI application for most users, as it provides a more user-friendly interface.
|
|
43
|
+
However faser can also be used as a library, and the CLI application is useful for scripting and batch processing.
|
|
44
|
+
|
|
45
|
+
#### Usage
|
|
46
|
+
|
|
47
|
+
To simulate the PSF, with a specific numerical aperture (NA) and a beam profile, you can run the following command:
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
faser --na 1.4 --window=NO
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
For more information and options you can run:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
faser --help
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
To display the GUI interface and the available options:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
__
|
|
63
|
+
/ _| __ _ ___ ___ _ __
|
|
64
|
+
| |_ / _` / __|/ _ \ '__|
|
|
65
|
+
| _| (_| \__ \ __/ |
|
|
66
|
+
|_| \__,_|___/\___|_|
|
|
67
|
+
|
|
68
|
+
Generating PSF with config
|
|
69
|
+
faser➜ faser git:(master) ✗ uv run faser --help
|
|
70
|
+
|
|
71
|
+
Usage: faser [OPTIONS]
|
|
72
|
+
|
|
73
|
+
╭─ Options ───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
|
|
74
|
+
│ --config FILENAME Path to a JSON file │
|
|
75
|
+
│ --detector_gaussian_noise FLOAT Detector Gaussian noise │
|
|
76
|
+
│ --gaussian_beam_noise FLOAT Gaussian_beam noise │
|
|
77
|
+
│ --add_noise NOISE │
|
|
78
|
+
│ --loaded_phase_mask OPTIONAL Loaded Phasemak │
|
|
79
|
+
│ --p FLOAT Ratio between Donut (p) and Bottle (1-p) intensity │
|
|
80
|
+
│ --mask_offset_y FLOAT Y offset of the phase mask in regard to pupil center │
|
|
81
|
+
│ --mask_offset_x FLOAT X offset of the phase mask in regard to pupil center │
|
|
82
|
+
│ --ring_radius FLOAT Radius of the ring phase mask (on unit pupil) │
|
|
83
|
+
│ --rc FLOAT Ring charge (should be odd to produce bottle) │
|
|
84
|
+
│ --vc FLOAT Vortex charge (should be integer to produce donut) │
|
|
85
|
+
│ --epsilon FLOAT Ellipticity of the polarization (in °) │
|
|
86
|
+
│ --psi FLOAT Direction of the polarization (in °) │
|
|
87
|
+
│ --ampl_offset_y FLOAT Y offset of the amplitude profile in regard to pupil center │
|
|
88
|
+
│ --ampl_offset_x FLOAT X offset of the amplitude profile in regard to pupil center │
|
|
89
|
+
│ --waist FLOAT Diameter of the input beam on the objective pupil (in µm) │
|
|
90
|
+
│ --wavelength FLOAT Wavelength of light (in µm) │
|
|
91
|
+
│ --polarization POLARIZATION │
|
|
92
|
+
│ --mode MODE │
|
|
93
|
+
│ --aberration_offset_y FLOAT Y offset of the aberration function in regard to pupil center │
|
|
94
|
+
│ --aberration_offset_x FLOAT X offset of the aberration function in regard to pupil center │
|
|
95
|
+
│ --a24 ABERRATIONFLOAT Secondary spherical │
|
|
96
|
+
│ --a12 ABERRATIONFLOAT Primary spherical │
|
|
97
|
+
│ --a9 ABERRATIONFLOAT Oblique Trefoil │
|
|
98
|
+
│ --a8 ABERRATIONFLOAT Horizontal Coma │
|
|
99
|
+
│ --a7 ABERRATIONFLOAT Vertical Coma │
|
|
100
|
+
│ --a6 ABERRATIONFLOAT Vertical Trefoil │
|
|
101
|
+
│ --a5 ABERRATIONFLOAT Vertical Astigmatism │
|
|
102
|
+
│ --a4 ABERRATIONFLOAT Defocus │
|
|
103
|
+
│ --a3 ABERRATIONFLOAT Oblique Astigmatism │
|
|
104
|
+
│ --a2 ABERRATIONFLOAT Horizontal Tilt │
|
|
105
|
+
│ --a1 ABERRATIONFLOAT Vertical Tilt │
|
|
106
|
+
│ --a0 ABERRATIONFLOAT Piston │
|
|
107
|
+
│ --wind_offset_y FLOAT Y offset of the cranial window in regard to pupil center │
|
|
108
|
+
│ --wind_offset_x FLOAT X offset of the cranial window in regard to pupil center │
|
|
109
|
+
│ --wind_depth FLOAT Depth of the cranial window (in mm) │
|
|
110
|
+
│ --wind_radius FLOAT Diameter of the cranial window (in mm) │
|
|
111
|
+
│ --window WINDOW │
|
|
112
|
+
│ --tilt FLOAT Tilt angle of the coverslip (in °) │
|
|
113
|
+
│ --depth FLOAT Imaging depth in the sample (in µm) │
|
|
114
|
+
│ --collar FLOAT Correction collar setting to compensate coverslip thickness │
|
|
115
|
+
│ --thickness FLOAT Thickness of the coverslip (in µm) │
|
|
116
|
+
│ --n3 FLOAT Refractive index of the sample │
|
|
117
|
+
│ --n2 FLOAT Refractive index of the coverslip │
|
|
118
|
+
│ --n1 FLOAT Refractive index of the immersion medium │
|
|
119
|
+
│ --wd FLOAT Working Distance of the objective lens (in µm) │
|
|
120
|
+
│ --na FLOAT Numerical Aperture of Objective Lens │
|
|
121
|
+
│ --normalize NORMALIZE │
|
|
122
|
+
│ --nphi INTEGER Integration sted of the aximutal angle on the pupil │
|
|
123
|
+
│ --ntheta INTEGER Integration sted of the focalization angle │
|
|
124
|
+
│ --nz INTEGER Discretization of Z axis - better be odd number for perfect 0 │
|
|
125
|
+
│ --nxy INTEGER Discretization of image plane - better be odd number for perfect 0 │
|
|
126
|
+
│ --l_obs_z FLOAT Observation scale in Z (in µm) │
|
|
127
|
+
│ --l_obs_xy FLOAT Observation scale in XY (in µm) │
|
|
128
|
+
│ --help Show this message and exit. │
|
|
129
|
+
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
|
faser-0.3.4/psf.tif
ADDED
|
Binary file
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
{
|
|
2
|
+
"L_obs_XY": 2.0,
|
|
3
|
+
"L_obs_Z": 2.0,
|
|
4
|
+
"Nxy": 31,
|
|
5
|
+
"Nz": 31,
|
|
6
|
+
"Ntheta": 31,
|
|
7
|
+
"Nphi": 31,
|
|
8
|
+
"Normalize": "NO",
|
|
9
|
+
"NA": 1.0,
|
|
10
|
+
"WD": 2800.0,
|
|
11
|
+
"n1": 1.33,
|
|
12
|
+
"n2": 1.52,
|
|
13
|
+
"n3": 1.38,
|
|
14
|
+
"Thickness": 170.0,
|
|
15
|
+
"Collar": 170.0,
|
|
16
|
+
"Depth": 0.0,
|
|
17
|
+
"Tilt": 0.0,
|
|
18
|
+
"Window": "NO",
|
|
19
|
+
"Wind_Radius": 2.3,
|
|
20
|
+
"Wind_Depth": 2.23,
|
|
21
|
+
"Wind_Offset_x": 0.0,
|
|
22
|
+
"Wind_Offset_y": 0.0,
|
|
23
|
+
"a0": 0.0,
|
|
24
|
+
"a1": 0.0,
|
|
25
|
+
"a2": 0.0,
|
|
26
|
+
"a3": 0.0,
|
|
27
|
+
"a4": 0.0,
|
|
28
|
+
"a5": 0.0,
|
|
29
|
+
"a6": 0.0,
|
|
30
|
+
"a7": 0.0,
|
|
31
|
+
"a8": 0.0,
|
|
32
|
+
"a9": 0.0,
|
|
33
|
+
"a12": 0.0,
|
|
34
|
+
"a24": 0.0,
|
|
35
|
+
"Aberration_offset_x": 0.0,
|
|
36
|
+
"Aberration_offset_y": 0.0,
|
|
37
|
+
"Mode": "GAUSSIAN",
|
|
38
|
+
"Polarization": 1,
|
|
39
|
+
"Wavelength": 0.592,
|
|
40
|
+
"Waist": 8000.0,
|
|
41
|
+
"Ampl_offset_x": 0.0,
|
|
42
|
+
"Ampl_offset_y": 0.0,
|
|
43
|
+
"Psi": 0.0,
|
|
44
|
+
"Epsilon": 45.0,
|
|
45
|
+
"VC": 1.0,
|
|
46
|
+
"RC": 1.0,
|
|
47
|
+
"Ring_Radius": 0.707,
|
|
48
|
+
"Mask_offset_x": 0.0,
|
|
49
|
+
"Mask_offset_y": 0.0,
|
|
50
|
+
"p": 0.5,
|
|
51
|
+
"loaded_phase_mask": null,
|
|
52
|
+
"Add_noise": "YES",
|
|
53
|
+
"Gaussian_beam_noise": 0.0,
|
|
54
|
+
"Detector_gaussian_noise": 0.0
|
|
55
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "faser"
|
|
3
|
-
version = "0.3.
|
|
3
|
+
version = "0.3.4"
|
|
4
4
|
description = "Faser is a tool for vectorial psf simulation"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Johannes Roos", email = "jhnnsrs@gmail.com" }
|
|
@@ -12,6 +12,8 @@ dependencies = [
|
|
|
12
12
|
"python-slugify>=8.0.4",
|
|
13
13
|
"tifffile>=2024.8.30",
|
|
14
14
|
"psygnal>=0.11.1",
|
|
15
|
+
"qtpy>=2.4.2",
|
|
16
|
+
"superqt>=0.6.7",
|
|
15
17
|
]
|
|
16
18
|
classifiers = [
|
|
17
19
|
"Framework :: napari",
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import sys
|
|
2
|
+
|
|
2
3
|
import matplotlib
|
|
3
4
|
|
|
4
5
|
matplotlib.use("Qt5Agg")
|
|
5
6
|
|
|
6
|
-
from PyQt5 import QtCore, QtWidgets
|
|
7
|
-
|
|
8
|
-
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
|
|
9
|
-
from matplotlib.figure import Figure
|
|
10
7
|
import napari
|
|
8
|
+
from matplotlib.backends.backend_qt import FigureCanvasQT
|
|
9
|
+
from matplotlib.figure import Figure
|
|
10
|
+
from qtpy import QtCore, QtWidgets
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
class MplCanvas(
|
|
13
|
+
class MplCanvas(FigureCanvasQT):
|
|
14
14
|
def __init__(self, parent=None, width=5, height=4, dpi=100):
|
|
15
15
|
fig = Figure(figsize=(width, height), dpi=dpi)
|
|
16
16
|
self.axes = fig.add_subplot(111)
|
|
@@ -15,9 +15,9 @@ from annotated_types import Ge, Gt, Le, Lt
|
|
|
15
15
|
# from faser.generators.vectorial.stephane.tilted_coverslip import generate_psf
|
|
16
16
|
from pydantic import BaseModel, Field
|
|
17
17
|
from pydantic.fields import FieldInfo
|
|
18
|
-
from
|
|
19
|
-
from
|
|
20
|
-
from qtpy import
|
|
18
|
+
from qtpy import QtCore, QtGui, QtWidgets
|
|
19
|
+
from qtpy.QtCore import Signal
|
|
20
|
+
from qtpy.QtWidgets import QWidget
|
|
21
21
|
from superqt import QEnumComboBox # QDoubleRangeSlider,
|
|
22
22
|
from superqt import QLabeledDoubleRangeSlider, QLabeledDoubleSlider
|
|
23
23
|
|
|
@@ -44,8 +44,8 @@ def get_field_lt(field: FieldInfo) -> float:
|
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
class FormField(QtWidgets.QWidget):
|
|
47
|
-
on_child_value_changed =
|
|
48
|
-
on_child_range_value_changed =
|
|
47
|
+
on_child_value_changed = Signal(str, object)
|
|
48
|
+
on_child_range_value_changed = Signal(str, object)
|
|
49
49
|
|
|
50
50
|
def __init__(
|
|
51
51
|
self, key: str, field: FieldInfo, toggable: bool = True, *args, **kwargs
|
|
@@ -220,7 +220,7 @@ class IntList(pydantic.BaseModel):
|
|
|
220
220
|
|
|
221
221
|
|
|
222
222
|
class FloatRangeStepSliderField(QtWidgets.QWidget):
|
|
223
|
-
on_range_changed =
|
|
223
|
+
on_range_changed = Signal(object)
|
|
224
224
|
|
|
225
225
|
def __init__(self, *args, gt=None, lt=None, steps=None, **kwargs):
|
|
226
226
|
super().__init__(*args, **kwargs)
|
|
@@ -279,7 +279,7 @@ class IntRange(pydantic.BaseModel):
|
|
|
279
279
|
|
|
280
280
|
|
|
281
281
|
class FloatRangeArrayField(QtWidgets.QWidget):
|
|
282
|
-
on_range_changed =
|
|
282
|
+
on_range_changed = Signal(object)
|
|
283
283
|
|
|
284
284
|
def __init__(self, default, *args, **kwargs):
|
|
285
285
|
super().__init__(*args, **kwargs)
|
|
@@ -333,7 +333,7 @@ class FloatRangeArrayField(QtWidgets.QWidget):
|
|
|
333
333
|
|
|
334
334
|
|
|
335
335
|
class IntRangeStepSliderField(QtWidgets.QWidget):
|
|
336
|
-
on_range_changed =
|
|
336
|
+
on_range_changed = Signal(object)
|
|
337
337
|
|
|
338
338
|
def __init__(self, *args, gt=None, lt=None, steps=None, **kwargs):
|
|
339
339
|
super().__init__(*args, **kwargs)
|
|
@@ -392,7 +392,7 @@ class FloatSliderField(FormField):
|
|
|
392
392
|
|
|
393
393
|
|
|
394
394
|
class IntRangeArrayField(QtWidgets.QWidget):
|
|
395
|
-
on_range_changed =
|
|
395
|
+
on_range_changed = Signal(object)
|
|
396
396
|
|
|
397
397
|
def __init__(self, default, *args, **kwargs):
|
|
398
398
|
super().__init__(*args, **kwargs)
|
|
@@ -492,7 +492,7 @@ class OptionRange(pydantic.BaseModel):
|
|
|
492
492
|
|
|
493
493
|
|
|
494
494
|
class MultiEnumField(QtWidgets.QWidget):
|
|
495
|
-
on_range_changed =
|
|
495
|
+
on_range_changed = Signal(object)
|
|
496
496
|
|
|
497
497
|
def __init__(self, *args, enum: Enum, **kwargs):
|
|
498
498
|
super().__init__(*args, **kwargs)
|
|
@@ -6,16 +6,17 @@ from typing import Any, Callable, List, Type
|
|
|
6
6
|
|
|
7
7
|
import dask
|
|
8
8
|
import dask.array as da
|
|
9
|
-
|
|
9
|
+
import matplotlib.pyplot as plt
|
|
10
10
|
import napari
|
|
11
11
|
import numpy as np
|
|
12
12
|
import pydantic
|
|
13
|
+
import skimage.draw as draw
|
|
13
14
|
import tifffile
|
|
14
|
-
from
|
|
15
|
-
from
|
|
16
|
-
from qtpy import
|
|
17
|
-
from
|
|
18
|
-
from scipy import signal
|
|
15
|
+
from matplotlib.figure import Figure
|
|
16
|
+
from qtpy import QtCore, QtGui, QtWidgets
|
|
17
|
+
from qtpy.QtCore import Signal
|
|
18
|
+
from qtpy.QtWidgets import QWidget
|
|
19
|
+
from scipy import ndimage, signal
|
|
19
20
|
from slugify import slugify
|
|
20
21
|
from superqt import (
|
|
21
22
|
QDoubleRangeSlider,
|
|
@@ -24,8 +25,7 @@ from superqt import (
|
|
|
24
25
|
QLabeledDoubleSlider,
|
|
25
26
|
)
|
|
26
27
|
from superqt.utils import thread_worker
|
|
27
|
-
|
|
28
|
-
import skimage.draw as draw
|
|
28
|
+
|
|
29
29
|
from faser.env import get_asset_file
|
|
30
30
|
from faser.generators.base import AberrationFloat, PSFConfig
|
|
31
31
|
from faser.generators.vectorial.stephane.tilted_coverslip import generate_psf
|
|
@@ -50,8 +50,8 @@ class HelperTab(QtWidgets.QWidget):
|
|
|
50
50
|
|
|
51
51
|
# Step 1: Create a worker class
|
|
52
52
|
class ExportWorker(QtCore.QObject):
|
|
53
|
-
finished =
|
|
54
|
-
progress =
|
|
53
|
+
finished = Signal()
|
|
54
|
+
progress = Signal(int)
|
|
55
55
|
|
|
56
56
|
def __init__(self, layers, export_dir):
|
|
57
57
|
super().__init__()
|
|
@@ -459,8 +459,8 @@ class ConvolveModel(pydantic.BaseModel):
|
|
|
459
459
|
|
|
460
460
|
# Step 1: Create a worker class
|
|
461
461
|
class ConvolveWorker(QtCore.QObject):
|
|
462
|
-
finished =
|
|
463
|
-
progress =
|
|
462
|
+
finished = Signal(object)
|
|
463
|
+
progress = Signal(int)
|
|
464
464
|
|
|
465
465
|
def __init__(self, image_data, psf_data):
|
|
466
466
|
super().__init__()
|
|
@@ -644,8 +644,8 @@ def calculate_config_labels(configs: PSFConfig):
|
|
|
644
644
|
|
|
645
645
|
# Step 1: Create a worker class
|
|
646
646
|
class MetricWorker(QtCore.QObject):
|
|
647
|
-
finished = QtCore.
|
|
648
|
-
progress = QtCore.
|
|
647
|
+
finished = QtCore.Signal(object, object)
|
|
648
|
+
progress = QtCore.Signal(int)
|
|
649
649
|
|
|
650
650
|
def __init__(self, psf_data, configs):
|
|
651
651
|
super().__init__()
|
|
@@ -15,10 +15,9 @@ import napari
|
|
|
15
15
|
|
|
16
16
|
# from pydantic.types import ConstrainedFloat
|
|
17
17
|
import numpy as np
|
|
18
|
-
from PyQt5 import QtCore
|
|
19
18
|
|
|
20
19
|
# from PyQt5.QtWidgets import QWidget
|
|
21
|
-
from qtpy import QtGui, QtWidgets
|
|
20
|
+
from qtpy import QtCore, QtGui, QtWidgets
|
|
22
21
|
from qtpy.QtWidgets import QStyle
|
|
23
22
|
|
|
24
23
|
# from superqt import QDoubleRangeSlider, QLabeledDoubleRangeSlider, QLabeledDoubleSlider
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import sys
|
|
2
2
|
import typing
|
|
3
|
-
|
|
3
|
+
|
|
4
4
|
import matplotlib
|
|
5
5
|
import numpy as np
|
|
6
|
+
from qtpy.QtWidgets import QWidget
|
|
6
7
|
|
|
7
8
|
matplotlib.use("Qt5Agg")
|
|
8
9
|
|
|
9
|
-
from PyQt5 import QtCore, QtWidgets
|
|
10
|
-
|
|
11
10
|
from matplotlib.backends.backend_qt5agg import FigureCanvasQTAgg
|
|
11
|
+
from matplotlib.cm import coolwarm, turbo, viridis
|
|
12
12
|
from matplotlib.figure import Figure
|
|
13
|
-
from
|
|
13
|
+
from qtpy import QtCore, QtWidgets
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class MplCanvas(FigureCanvasQTAgg):
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import sys
|
|
2
|
-
import matplotlib
|
|
3
|
-
|
|
4
|
-
matplotlib.use("Qt5Agg")
|
|
5
|
-
|
|
6
|
-
from PyQt5 import QtCore, QtWidgets
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
from matplotlib.figure import Figure
|
|
3
|
+
import matplotlib
|
|
10
4
|
import napari
|
|
5
|
+
from matplotlib.backends.backend_qt import FigureCanvasQT
|
|
6
|
+
from matplotlib.figure import Figure
|
|
7
|
+
from qtpy import QtCore, QtWidgets
|
|
11
8
|
|
|
12
9
|
|
|
13
|
-
class MplCanvas(
|
|
10
|
+
class MplCanvas(FigureCanvasQT):
|
|
14
11
|
def __init__(self, parent=None, width=5, height=4, dpi=100):
|
|
15
12
|
fig = Figure(figsize=(width, height), dpi=dpi)
|
|
16
13
|
self.axes = fig.add_subplot(111)
|