AMS-BP 0.0.21__tar.gz → 0.0.22__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.
- {ams_bp-0.0.21 → ams_bp-0.0.22}/PKG-INFO +1 -1
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/optics/psf/psf_engine.md +42 -3
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/sim_config.md +1 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/__init__.py +1 -1
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/configio/convertconfig.py +2 -1
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/metadata/metadata.py +2 -2
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/psf/psf_engine.py +79 -35
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/run_cell_simulation.py +3 -3
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/sim_config.toml +1 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/sim_microscopy.py +1 -1
- {ams_bp-0.0.21 → ams_bp-0.0.22}/.github/workflows/lint.yml +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/.github/workflows/pages.yml +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/.github/workflows/publish_pypi.yml +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/.gitignore +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/LICENSE +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/README.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/cells/base_cell.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/cells/rectangular_cell.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/cells/rod_cell.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/cells/spherical_cell.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/configio/configmodels.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/configio/convertconfig.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/configio/experiments.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/configio/saving.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/metadata/metadata.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/motion/condensate_movement.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/motion/movement/boundary_conditions.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/motion/movement/fbm_BP.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/motion/track_gen.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/optics/camera/detectors.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/optics/camera/quantum_eff.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/optics/filters/channels/channelschema.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/optics/filters/filters.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/optics/lasers/laser_profiles.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/photophysics/photon_physics.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/photophysics/state_kinetics.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/probabilityfuncs/markov_chain.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/probabilityfuncs/probability_functions.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/run_cell_simulation.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/sample/flurophore/flurophore_schema.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/sample/sim_sampleplane.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/sim_microscopy.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/utils/constants.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/utils/errors.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/utils/util_functions.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/assets/icons/Cells-actin-like-a-tree-Jamie-Whitelaw-1.png +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/assets/icons/drawing.pdf +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/assets/icons/drawing.png +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/assets/icons/drawing.svg +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/docs/index.md +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/mkdocs.yml +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/pyproject.toml +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/pytest.ini +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/cells/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/cells/base_cell.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/cells/rectangular_cell.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/cells/rod_cell.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/cells/spherical_cell.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/configio/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/configio/configmodels.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/configio/experiments.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/configio/saving.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/metadata/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/motion/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/motion/condensate_movement.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/motion/movement/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/motion/movement/boundary_conditions.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/motion/movement/fbm_BP.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/motion/track_gen.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/camera/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/camera/detectors.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/camera/quantum_eff.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/filters/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/filters/channels/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/filters/channels/channelschema.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/filters/filters.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/lasers/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/lasers/laser_profiles.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/optics/psf/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/photophysics/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/photophysics/photon_physics.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/photophysics/state_kinetics.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/probabilityfuncs/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/probabilityfuncs/markov_chain.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/probabilityfuncs/probability_functions.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/sample/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/sample/flurophores/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/sample/flurophores/flurophore_schema.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/sample/sim_sampleplane.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/utils/__init__.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/utils/constants.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/utils/decorators.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/utils/errors.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/utils/maskMaker.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/src/AMS_BP/utils/util_functions.py +0 -0
- {ams_bp-0.0.21 → ams_bp-0.0.22}/uv.lock +0 -0
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: AMS_BP
|
3
|
-
Version: 0.0.
|
3
|
+
Version: 0.0.22
|
4
4
|
Summary: Advanced Microscopy Simulations developed for the Weber Lab by Baljyot Singh Parmar
|
5
5
|
Project-URL: Documentation, https://joemans3.github.io/AMS_BP/
|
6
6
|
Project-URL: Source code, https://github.com/joemans3/AMS_BP
|
@@ -12,14 +12,35 @@ This module provides functionality for generating Point Spread Functions (PSFs)
|
|
12
12
|
- [_calculate_sigma_z](#_calculate_sigma_z)
|
13
13
|
- [_generate_grid](#_generate_grid)
|
14
14
|
- [calculate_psf_size](#calculate_psf_size)
|
15
|
+
- [_generate_pinhole_mask](#_generate_pinhole_mask)
|
15
16
|
|
16
17
|
---
|
17
18
|
|
18
19
|
## Classes
|
19
20
|
|
20
21
|
### `PSFParameters`
|
21
|
-
|
22
|
-
|
22
|
+
#### Description
|
23
|
+
This is a frozen dataclass (enum-ish?) with the following parameters / cached properties
|
24
|
+
```python
|
25
|
+
emission_wavelength: float
|
26
|
+
numerical_aperture: float
|
27
|
+
pixel_size: float
|
28
|
+
z_step: float
|
29
|
+
refractive_index: float = 1.0
|
30
|
+
pinhole_diameter: Optional[float] = None # um
|
31
|
+
|
32
|
+
@cached_property
|
33
|
+
def wavelength_um(self) -> float:
|
34
|
+
"""Emission wavelength in micrometers."""
|
35
|
+
return self.emission_wavelength / 1000.0
|
36
|
+
@cached_property
|
37
|
+
def pinhole_radius(self) -> Optional[float]:
|
38
|
+
"""Pinhole radius in micrometers."""
|
39
|
+
return (
|
40
|
+
self.pinhole_diameter / 2.0 if self.pinhole_diameter is not None else None
|
41
|
+
)
|
42
|
+
```
|
43
|
+
### `PSFEngine`
|
23
44
|
#### Methods
|
24
45
|
|
25
46
|
- **`__init__`**: Initializes the PSF engine with the given parameters.
|
@@ -29,6 +50,7 @@ This module provides functionality for generating Point Spread Functions (PSFs)
|
|
29
50
|
- **`_3d_normalization_A`**: Computes the normalization factor for a 3D Gaussian PSF.
|
30
51
|
- **`_2d_normalization_A`**: Computes the normalization factor for a 2D Gaussian PSF.
|
31
52
|
- **`normalize_psf`**: Normalizes the PSF using different schemes.
|
53
|
+
- **`_generate_pinhole_mask`**: Generate a binary mask representing the pinhole's spatial filtering.
|
32
54
|
|
33
55
|
---
|
34
56
|
|
@@ -105,4 +127,21 @@ Calculates the appropriate PSF size based on physical parameters.
|
|
105
127
|
|
106
128
|
#### Returns
|
107
129
|
|
108
|
-
- **`Tuple[int, ...]`**: Tuple of dimensions (z, y, x) or (y, x) for the PSF calculation.
|
130
|
+
- **`Tuple[int, ...]`**: Tuple of dimensions (z, y, x) or (y, x) for the PSF calculation.
|
131
|
+
|
132
|
+
---
|
133
|
+
|
134
|
+
### `_generate_pinhole_mask`
|
135
|
+
|
136
|
+
|
137
|
+
#### Description
|
138
|
+
|
139
|
+
Generate a binary mask representing the pinhole's spatial filtering.
|
140
|
+
|
141
|
+
The pinhole blocks emission light based on position in the image plane,
|
142
|
+
affecting what portion of the diffracted light reaches the detector.
|
143
|
+
|
144
|
+
#### Parameters
|
145
|
+
#### Returns
|
146
|
+
|
147
|
+
- **`NDArray[np.float64]`**: Same dimensions as the psf generated but with binary values (0,1) indicating the transmittance of the psf due to the pinhole. Note, if the pinhole size is smaller than 1*airy disk diameter, then diffraction due to the pinhole is NOT non negligiable and diffraction effects will be introduced. A ValueError is thrown if this is the case.
|
@@ -224,6 +224,7 @@ Each fluorophore has transitions defined with the following parameters:
|
|
224
224
|
- **Properties**:
|
225
225
|
- **`numerical_aperture`**: The numerical aperture (typical range: 0.1 - 1.5).
|
226
226
|
- **`refractive_index`**: The refractive index (default is air: 1.0).
|
227
|
+
- **`pinhole_diameter`**: None or float. In units of um. None = no pinhole before the detector.
|
227
228
|
|
228
229
|
---
|
229
230
|
|
@@ -324,11 +324,12 @@ class ConfigLoader:
|
|
324
324
|
):
|
325
325
|
# Create PSFParameters instance
|
326
326
|
parameters = PSFParameters(
|
327
|
-
|
327
|
+
emission_wavelength=wavelength,
|
328
328
|
numerical_aperture=float(params_config["numerical_aperture"]),
|
329
329
|
pixel_size=pixel_size,
|
330
330
|
z_step=float(params_config["z_step"]) if z_step is None else z_step,
|
331
331
|
refractive_index=float(params_config.get("refractive_index", 1.0)),
|
332
|
+
pinhole_diameter=params_config.get("pinhole_diameter", None),
|
332
333
|
)
|
333
334
|
|
334
335
|
# Create PSF engine
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import Iterator, List, Literal, Union
|
1
|
+
from typing import Dict, Iterator, List, Literal, Union
|
2
2
|
|
3
3
|
from pydantic import BaseModel
|
4
4
|
|
@@ -77,7 +77,7 @@ class MetaData(BaseModel):
|
|
77
77
|
PhysicalSizeXUnit: Literal["nm", "m"]
|
78
78
|
PhysicalSizeY: float
|
79
79
|
PhysicalSizeYUnit: Literal["nm", "m"]
|
80
|
-
|
80
|
+
Channel: Dict[Literal["Name"], List[str]]
|
81
81
|
|
82
82
|
def __post_init__(self):
|
83
83
|
if isinstance(self.notes, (list, str)):
|
@@ -5,52 +5,61 @@ from typing import Literal, Optional, Tuple
|
|
5
5
|
import numpy as np
|
6
6
|
from numpy.typing import NDArray
|
7
7
|
|
8
|
+
AIRYFACTOR = 1.0
|
9
|
+
|
8
10
|
|
9
11
|
@dataclass(frozen=True)
|
10
12
|
class PSFParameters:
|
11
|
-
"""Parameters for PSF (Point Spread Function)
|
13
|
+
"""Parameters for emission PSF (Point Spread Function) at the detector.
|
14
|
+
|
15
|
+
|
16
|
+
This class defines parameters that determine how light from a point source
|
17
|
+
(e.g., a fluorescent molecule) diffracts through the collection optics
|
18
|
+
to form a pattern at the detector.
|
12
19
|
|
13
20
|
Attributes:
|
14
|
-
|
15
|
-
numerical_aperture: Numerical aperture of the
|
16
|
-
pixel_size: Size of pixels in micrometers
|
21
|
+
emission_wavelength: Emission wavelength in nanometers
|
22
|
+
numerical_aperture: Numerical aperture of the collection objective
|
23
|
+
pixel_size: Size of pixels in micrometers at the detector
|
17
24
|
z_step: Axial step size in micrometers
|
18
25
|
refractive_index: Refractive index of the medium (default: 1.0 for air)
|
26
|
+
pinhole_diameter: Diameter of the pinhole in micrometers (default: None for widefield)
|
27
|
+
The pinhole spatially filters the emitted light before it reaches
|
28
|
+
the detector.
|
19
29
|
"""
|
20
30
|
|
21
|
-
|
31
|
+
emission_wavelength: float
|
22
32
|
numerical_aperture: float
|
23
33
|
pixel_size: float
|
24
34
|
z_step: float
|
25
35
|
refractive_index: float = 1.0
|
26
|
-
|
27
|
-
# def __post_init__(self) -> None:
|
28
|
-
# """Validate parameters after initialization."""
|
29
|
-
# if any(
|
30
|
-
# param <= 0
|
31
|
-
# for param in (
|
32
|
-
# self.wavelength,
|
33
|
-
# self.numerical_aperture,
|
34
|
-
# self.pixel_size,
|
35
|
-
# self.z_step,
|
36
|
-
# self.refractive_index,
|
37
|
-
# )
|
38
|
-
# ):
|
39
|
-
# raise ValueError("All parameters must be positive numbers")
|
40
|
-
# if self.numerical_aperture >= self.refractive_index:
|
41
|
-
# raise ValueError("Numerical aperture must be less than refractive index")
|
36
|
+
pinhole_diameter: Optional[float] = None # um
|
42
37
|
|
43
38
|
@cached_property
|
44
39
|
def wavelength_um(self) -> float:
|
45
|
-
"""
|
46
|
-
return self.
|
40
|
+
"""Emission wavelength in micrometers."""
|
41
|
+
return self.emission_wavelength / 1000.0
|
42
|
+
|
43
|
+
@cached_property
|
44
|
+
def pinhole_radius(self) -> Optional[float]:
|
45
|
+
"""Pinhole radius in micrometers."""
|
46
|
+
return (
|
47
|
+
self.pinhole_diameter / 2.0 if self.pinhole_diameter is not None else None
|
48
|
+
)
|
47
49
|
|
48
50
|
|
49
51
|
class PSFEngine:
|
50
|
-
"""Engine for
|
52
|
+
"""Engine for calculating emission light PSF at the detector.
|
53
|
+
|
54
|
+
This class calculates how light from a point source (like a fluorescent molecule)
|
55
|
+
spreads due to diffraction through the collection optics to form a pattern at
|
56
|
+
the detector. For confocal systems, it can include the effect of a pinhole
|
57
|
+
that spatially filters the light before detection.
|
51
58
|
|
52
|
-
This
|
53
|
-
|
59
|
+
Note: This PSF describes only the diffraction of emitted light through the
|
60
|
+
collection optics. While a confocal microscope uses focused illumination to
|
61
|
+
excite molecules, that illumination pattern does not affect how the emitted
|
62
|
+
light diffracts to form the PSF we calculate here.
|
54
63
|
"""
|
55
64
|
|
56
65
|
def __init__(self, params: PSFParameters):
|
@@ -79,34 +88,69 @@ class PSFEngine:
|
|
79
88
|
self._norm_sigma_xy = self._sigma_xy / 2.355
|
80
89
|
self._norm_sigma_z = self._sigma_z / 2.355
|
81
90
|
|
91
|
+
# Generate pinhole mask if specified
|
92
|
+
if self.params.pinhole_radius is not None:
|
93
|
+
if self.params.pinhole_radius < AIRYFACTOR * self._sigma_xy:
|
94
|
+
raise ValueError(
|
95
|
+
f"Pinhole size ({self.params.pinhole_radius} um) is smaller than {AIRYFACTOR} times the Airy lobe. This will diffract the emission light in the pinhole; an ideal pinhole size for this setup is {self._sigma_xy} um."
|
96
|
+
)
|
97
|
+
self._pinhole_mask = self._generate_pinhole_mask()
|
98
|
+
else:
|
99
|
+
self._pinhole_mask = None
|
100
|
+
|
101
|
+
def _generate_pinhole_mask(self) -> NDArray[np.float64]:
|
102
|
+
"""Generate a binary mask representing the pinhole's spatial filtering.
|
103
|
+
|
104
|
+
The pinhole blocks emission light based on position in the image plane,
|
105
|
+
affecting what portion of the diffracted light reaches the detector.
|
106
|
+
"""
|
107
|
+
x, y = self._grid_xy
|
108
|
+
r = np.sqrt(x**2 + y**2)
|
109
|
+
return (r <= self.params.pinhole_radius).astype(np.float64)
|
110
|
+
|
82
111
|
@lru_cache(maxsize=128)
|
83
112
|
def psf_z(self, z_val: float) -> NDArray[np.float64]:
|
84
|
-
"""
|
113
|
+
"""Calculate the PSF at the detector for a point source at z_val.
|
114
|
+
|
115
|
+
This represents how light from a point source at position z_val
|
116
|
+
diffracts through the collection optics to form a pattern at the
|
117
|
+
detector. If a pinhole is present, it spatially filters this pattern.
|
85
118
|
|
86
119
|
Args:
|
87
|
-
z_val: Z-position in micrometers
|
120
|
+
z_val: Z-position of the point source in micrometers
|
88
121
|
|
89
122
|
Returns:
|
90
|
-
2D array containing the
|
123
|
+
2D array containing the light intensity pattern at the detector
|
91
124
|
"""
|
92
125
|
x, y = self._grid_xy
|
93
126
|
|
94
|
-
#
|
127
|
+
# Calculate how light from the point source diffracts through collection optics
|
95
128
|
r_squared = (x / self._norm_sigma_xy) ** 2 + (y / self._norm_sigma_xy) ** 2
|
96
129
|
z_term = (z_val / self._norm_sigma_z) ** 2
|
97
|
-
|
130
|
+
psf_at_detector = np.exp(-0.5 * (r_squared + z_term))
|
131
|
+
|
132
|
+
if self._pinhole_mask is not None:
|
133
|
+
# Apply pinhole's spatial filtering
|
134
|
+
return psf_at_detector * self._pinhole_mask
|
135
|
+
|
136
|
+
return psf_at_detector
|
98
137
|
|
99
138
|
@lru_cache(maxsize=128)
|
100
139
|
def psf_z_xy0(self, z_val: float) -> float:
|
101
|
-
"""
|
140
|
+
"""Calculate the PSF intensity at the center of the detector.
|
141
|
+
|
142
|
+
For a point source at z_val, this gives the intensity of light
|
143
|
+
that reaches the detector center (x=y=0). This point is always
|
144
|
+
within the pinhole if one is present.
|
102
145
|
|
103
146
|
Args:
|
104
|
-
z_val: Z-position in micrometers
|
147
|
+
z_val: Z-position of the point source in micrometers
|
105
148
|
|
106
149
|
Returns:
|
107
|
-
|
150
|
+
Light intensity at detector center
|
108
151
|
"""
|
109
|
-
|
152
|
+
z_term = (z_val / self._norm_sigma_z) ** 2
|
153
|
+
return np.exp(-0.5 * z_term)
|
110
154
|
|
111
155
|
@cache
|
112
156
|
def _3d_normalization_A(
|
@@ -1,14 +1,14 @@
|
|
1
1
|
"""
|
2
2
|
run_cell_simulation.py
|
3
3
|
|
4
|
-
This file contains the command-line interface (CLI) for the
|
4
|
+
This file contains the command-line interface (CLI) for the AMS_BP package.
|
5
5
|
|
6
6
|
The CLI is built using Typer and provides two main commands:
|
7
7
|
1. 'config': Generates a sample configuration file.
|
8
8
|
2. 'runsim': Runs the cell simulation using a provided configuration file.
|
9
9
|
|
10
10
|
Main Components:
|
11
|
-
-
|
11
|
+
- typer_app_asms_bp: The main Typer application object.
|
12
12
|
- cell_simulation(): Callback function that displays the version information.
|
13
13
|
- generate_config(): Command to generate a sample configuration file.
|
14
14
|
- run_cell_simulation(): Command to run the cell simulation using a configuration file.
|
@@ -37,7 +37,7 @@ from .configio.saving import save_config_frames
|
|
37
37
|
|
38
38
|
cli_help_doc = str(
|
39
39
|
"""
|
40
|
-
CLI tool to run [underline]A[/underline]dvanced [underline]M[/underline]olecule [underline]S[/underline]imulation: [underline]
|
40
|
+
CLI tool to run [underline]A[/underline]dvanced [underline]M[/underline]olecule [underline]S[/underline]imulation: [underline]AMS[/underline]-BP. GitHub: [green]https://github.com/joemans3/AMS_BP[/green].
|
41
41
|
[Version: [bold]{0}[/bold]]
|
42
42
|
""".format(__version__)
|
43
43
|
)
|
@@ -275,6 +275,7 @@ custom_path = ""
|
|
275
275
|
[psf.parameters]
|
276
276
|
numerical_aperture = 1.4 # typical range: 0.1 - 1.5
|
277
277
|
refractive_index = 1.0 # default is air (1.0)
|
278
|
+
#pinhole_diameter = 1.0 # Do not include for no pinhole else float in um units
|
278
279
|
|
279
280
|
# Multiple Laser Configuration File
|
280
281
|
|
@@ -276,7 +276,7 @@ class VirtualMicroscope:
|
|
276
276
|
PhysicalSizeXUnit="m",
|
277
277
|
PhysicalSizeY=self.camera.pixel_size * 1e-6,
|
278
278
|
PhysicalSizeYUnit="m",
|
279
|
-
|
279
|
+
Channel={"Name": self.channels.names},
|
280
280
|
)
|
281
281
|
|
282
282
|
# return frames in the format ZCTYX
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/motion/movement/boundary_conditions.md
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/optics/filters/channels/channelschema.md
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/probabilityfuncs/probability_functions.md
RENAMED
File without changes
|
File without changes
|
{ams_bp-0.0.21 → ams_bp-0.0.22}/docs/API_Documentation/sample/flurophore/flurophore_schema.md
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{ams_bp-0.0.21 → ams_bp-0.0.22}/docs/assets/icons/Cells-actin-like-a-tree-Jamie-Whitelaw-1.png
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|