AMS-BP 0.0.3__tar.gz → 0.0.11__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.3 → ams_bp-0.0.11}/.github/workflows/lint.yml +1 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/PKG-INFO +42 -20
- {ams_bp-0.0.3 → ams_bp-0.0.11}/README.md +39 -18
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/configio/configmodels.md +19 -12
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/configio/convertconfig.md +3 -3
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/optics/psf/psf_engine.md +3 -42
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/sim_config.md +7 -8
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/index.md +1 -4
- {ams_bp-0.0.3 → ams_bp-0.0.11}/mkdocs.yml +0 -1
- {ams_bp-0.0.3 → ams_bp-0.0.11}/pyproject.toml +2 -3
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/__init__.py +1 -1
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/configio/configmodels.py +15 -14
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/configio/convertconfig.py +23 -32
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/metadata/metadata.py +2 -2
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/motion/condensate_movement.py +45 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/motion/movement/fbm_BP.py +5 -4
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/motion/track_gen.py +6 -6
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/camera/detectors.py +1 -1
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/lasers/laser_profiles.py +177 -15
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/psf/psf_engine.py +38 -93
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/photophysics/photon_physics.py +4 -4
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/photophysics/state_kinetics.py +1 -4
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/run_cell_simulation.py +3 -3
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/sim_config.toml +28 -42
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/sim_microscopy.py +2 -4
- {ams_bp-0.0.3 → ams_bp-0.0.11}/uv.lock +77 -1143
- ams_bp-0.0.3/docs/assets/icons/Cells-actin-like-a-tree-Jamie-Whitelaw-1.png +0 -0
- ams_bp-0.0.3/docs/assets/icons/drawing.pdf +0 -0
- ams_bp-0.0.3/docs/assets/icons/drawing.png +0 -0
- ams_bp-0.0.3/docs/assets/icons/drawing.svg +0 -107
- ams_bp-0.0.3/examples/QuantitativeExperiments/FRAP_base_[[0. 0.]].txt +0 -10
- ams_bp-0.0.3/examples/QuantitativeExperiments/FRAP_base_[[0.04 0.04]].txt +0 -10
- ams_bp-0.0.3/examples/QuantitativeExperiments/FRAP_base_[[0.1 0.1]].txt +0 -10
- ams_bp-0.0.3/examples/QuantitativeExperiments/FRAP_base_[[0.4 0.4]].txt +0 -10
- ams_bp-0.0.3/examples/QuantitativeExperiments/FRAP_data_[[0. 0.]].txt +0 -10
- ams_bp-0.0.3/examples/QuantitativeExperiments/FRAP_data_[[0.04 0.04]].txt +0 -10
- ams_bp-0.0.3/examples/QuantitativeExperiments/FRAP_data_[[0.1 0.1]].txt +0 -10
- ams_bp-0.0.3/examples/QuantitativeExperiments/FRAP_data_[[0.4 0.4]].txt +0 -10
- ams_bp-0.0.3/examples/QuantitativeExperiments/FRAP_methods.ipynb +0 -1025
- ams_bp-0.0.3/examples/VisualizingIndividualModules/laser_modulation.ipynb +0 -1094
- ams_bp-0.0.3/examples/VisualizingIndividualModules/modules_explained.ipynb +0 -1466
- {ams_bp-0.0.3 → ams_bp-0.0.11}/.github/workflows/pages.yml +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/.github/workflows/publish_pypi.yml +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/.gitignore +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/LICENSE +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/cells/base_cell.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/cells/rectangular_cell.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/cells/rod_cell.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/cells/spherical_cell.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/configio/experiments.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/configio/saving.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/metadata/metadata.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/motion/condensate_movement.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/motion/movement/boundary_conditions.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/motion/movement/fbm_BP.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/motion/track_gen.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/optics/camera/detectors.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/optics/camera/quantum_eff.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/optics/filters/channels/channelschema.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/optics/filters/filters.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/optics/lasers/laser_profiles.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/photophysics/photon_physics.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/photophysics/state_kinetics.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/probabilityfuncs/markov_chain.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/probabilityfuncs/probability_functions.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/run_cell_simulation.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/sample/flurophore/flurophore_schema.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/sample/sim_sampleplane.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/sim_microscopy.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/utils/constants.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/utils/errors.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/docs/API_Documentation/utils/util_functions.md +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/pytest.ini +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/cells/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/cells/base_cell.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/cells/rectangular_cell.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/cells/rod_cell.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/cells/spherical_cell.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/configio/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/configio/experiments.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/configio/saving.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/metadata/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/motion/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/motion/movement/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/motion/movement/boundary_conditions.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/camera/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/camera/quantum_eff.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/filters/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/filters/channels/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/filters/channels/channelschema.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/filters/filters.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/lasers/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/optics/psf/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/photophysics/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/probabilityfuncs/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/probabilityfuncs/markov_chain.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/probabilityfuncs/probability_functions.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/sample/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/sample/flurophores/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/sample/flurophores/flurophore_schema.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/sample/sim_sampleplane.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/utils/__init__.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/utils/constants.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/utils/decorators.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/utils/errors.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/utils/maskMaker.py +0 -0
- {ams_bp-0.0.3 → ams_bp-0.0.11}/src/AMS_BP/utils/util_functions.py +0 -0
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: AMS_BP
|
3
|
-
Version: 0.0.
|
4
|
-
Summary: Advanced Microscopy Simulations developed for the Weber Lab by Baljyot Singh Parmar
|
3
|
+
Version: 0.0.11
|
4
|
+
Summary: Advanced Molecule Simulations and 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
|
7
7
|
Author-email: Baljyot Singh Parmar <baljyotparmar@hotmail.com>
|
@@ -10,6 +10,7 @@ License-File: LICENSE
|
|
10
10
|
Keywords: SMS
|
11
11
|
Requires-Python: >=3.10
|
12
12
|
Requires-Dist: jsonschema>=4.23.0
|
13
|
+
Requires-Dist: matplotlib>=3.6.0
|
13
14
|
Requires-Dist: numpy>=1.21.2
|
14
15
|
Requires-Dist: pydantic>=2.9.2
|
15
16
|
Requires-Dist: scikit-image>=0.18.3
|
@@ -18,17 +19,11 @@ Requires-Dist: tomli>=2.0.2
|
|
18
19
|
Requires-Dist: typer>=0.12.5
|
19
20
|
Description-Content-Type: text/markdown
|
20
21
|
|
21
|
-
# AMS-BP
|
22
|
-
|
23
|
-
<img src="./docs/assets/icons/drawing.svg" alt="AMS-BP Logo" width="500" height="200">
|
24
|
-
</p>
|
25
|
-
|
26
|
-
## Advanced Fluorescence Microscopy Simulation Tool
|
22
|
+
# AMS-BP User Guide
|
23
|
+
## Advanced Molecule Simulation Tool
|
27
24
|
|
28
25
|
AMS-BP is a powerful simulation tool for advanced fluorescence microscopy experiments. This guide covers both command-line usage and library integration.
|
29
26
|
|
30
|
-
> **_NOTE:_** Please note that this application DOES NOT currently model the process of stimulated emission, and as such is not suitable for simulating stimulated emission microscopy ([STED](https://en.wikipedia.org/wiki/STED_microscopy))-type experiments. Work in this area is ongoing.
|
31
|
-
|
32
27
|
## Table of Contents
|
33
28
|
- [Installation](#installation)
|
34
29
|
- [Command Line Interface](#command-line-interface)
|
@@ -54,14 +49,6 @@ uv tool install AMS_BP
|
|
54
49
|
- `run_AMS_BP config` : This is a helper tool to generate a template config file for the simulation. (see `run_AMS_BP config --help` for more details)
|
55
50
|
- Note: using `run_AMS_BP --help` will show you all the available commands.
|
56
51
|
4. You can now use these tools (they are isolated in their own env created by uv, which is cool).
|
57
|
-
|
58
|
-
### ***PyPi***
|
59
|
-
|
60
|
-
1. Run:
|
61
|
-
```bash
|
62
|
-
pip install AMS_BP
|
63
|
-
```
|
64
|
-
|
65
52
|
## Command Line Interface
|
66
53
|
|
67
54
|
AMS-BP provides a command-line interface with two main commands:
|
@@ -83,7 +70,7 @@ run_AMS_BP runsim CONFIG_FILE
|
|
83
70
|
|
84
71
|
The configuration file (sim_config.toml) is divided into several key sections:
|
85
72
|
|
86
|
-
#### For a detailed description of the configuration file, refer to the [Configuration File Reference](
|
73
|
+
#### For a detailed description of the configuration file, refer to the [Configuration File Reference](./API_Documentation/sim_config.md).
|
87
74
|
### Basic Units
|
88
75
|
```toml
|
89
76
|
version = "0.1"
|
@@ -172,4 +159,39 @@ from AMS_BP.configio.saving import save_config_frames
|
|
172
159
|
save_config_frames(metadata, frames, setup_config["base_config"].OutputParameters)
|
173
160
|
```
|
174
161
|
|
175
|
-
|
162
|
+
### Key Components When Using as Library
|
163
|
+
|
164
|
+
1. **ConfigLoader**: Handles configuration file parsing and validation
|
165
|
+
2. **Microscope**: Represents the virtual microscope setup
|
166
|
+
3. **Experiment Functions**: Control experiment execution
|
167
|
+
4. **Save Functions**: Handle data output
|
168
|
+
|
169
|
+
### Custom Experiment Types
|
170
|
+
|
171
|
+
When using AMS-BP as a library, you can create custom experiment types by:
|
172
|
+
|
173
|
+
1. Extending the base experiment class
|
174
|
+
2. Implementing custom scanning patterns
|
175
|
+
3. Defining new molecule behaviors
|
176
|
+
4. Creating specialized analysis routines
|
177
|
+
|
178
|
+
## Tips and Best Practices
|
179
|
+
|
180
|
+
1. **Configuration Management**
|
181
|
+
- Keep separate config files for different experiment types
|
182
|
+
- Version control your configurations
|
183
|
+
- Document any custom modifications
|
184
|
+
|
185
|
+
2. **Resource Usage**
|
186
|
+
- Monitor memory usage for large simulations
|
187
|
+
- Use appropriate sampling rates
|
188
|
+
|
189
|
+
3. **Data Output**
|
190
|
+
- Set appropriate output paths
|
191
|
+
- Use meaningful naming conventions
|
192
|
+
- Consider data format requirements for analysis
|
193
|
+
|
194
|
+
## Troubleshooting
|
195
|
+
|
196
|
+
Common issues and their solutions:
|
197
|
+
TODO
|
@@ -1,14 +1,8 @@
|
|
1
|
-
# AMS-BP
|
2
|
-
|
3
|
-
<img src="./docs/assets/icons/drawing.svg" alt="AMS-BP Logo" width="500" height="200">
|
4
|
-
</p>
|
5
|
-
|
6
|
-
## Advanced Fluorescence Microscopy Simulation Tool
|
1
|
+
# AMS-BP User Guide
|
2
|
+
## Advanced Molecule Simulation Tool
|
7
3
|
|
8
4
|
AMS-BP is a powerful simulation tool for advanced fluorescence microscopy experiments. This guide covers both command-line usage and library integration.
|
9
5
|
|
10
|
-
> **_NOTE:_** Please note that this application DOES NOT currently model the process of stimulated emission, and as such is not suitable for simulating stimulated emission microscopy ([STED](https://en.wikipedia.org/wiki/STED_microscopy))-type experiments. Work in this area is ongoing.
|
11
|
-
|
12
6
|
## Table of Contents
|
13
7
|
- [Installation](#installation)
|
14
8
|
- [Command Line Interface](#command-line-interface)
|
@@ -34,14 +28,6 @@ uv tool install AMS_BP
|
|
34
28
|
- `run_AMS_BP config` : This is a helper tool to generate a template config file for the simulation. (see `run_AMS_BP config --help` for more details)
|
35
29
|
- Note: using `run_AMS_BP --help` will show you all the available commands.
|
36
30
|
4. You can now use these tools (they are isolated in their own env created by uv, which is cool).
|
37
|
-
|
38
|
-
### ***PyPi***
|
39
|
-
|
40
|
-
1. Run:
|
41
|
-
```bash
|
42
|
-
pip install AMS_BP
|
43
|
-
```
|
44
|
-
|
45
31
|
## Command Line Interface
|
46
32
|
|
47
33
|
AMS-BP provides a command-line interface with two main commands:
|
@@ -63,7 +49,7 @@ run_AMS_BP runsim CONFIG_FILE
|
|
63
49
|
|
64
50
|
The configuration file (sim_config.toml) is divided into several key sections:
|
65
51
|
|
66
|
-
#### For a detailed description of the configuration file, refer to the [Configuration File Reference](
|
52
|
+
#### For a detailed description of the configuration file, refer to the [Configuration File Reference](./API_Documentation/sim_config.md).
|
67
53
|
### Basic Units
|
68
54
|
```toml
|
69
55
|
version = "0.1"
|
@@ -152,4 +138,39 @@ from AMS_BP.configio.saving import save_config_frames
|
|
152
138
|
save_config_frames(metadata, frames, setup_config["base_config"].OutputParameters)
|
153
139
|
```
|
154
140
|
|
155
|
-
|
141
|
+
### Key Components When Using as Library
|
142
|
+
|
143
|
+
1. **ConfigLoader**: Handles configuration file parsing and validation
|
144
|
+
2. **Microscope**: Represents the virtual microscope setup
|
145
|
+
3. **Experiment Functions**: Control experiment execution
|
146
|
+
4. **Save Functions**: Handle data output
|
147
|
+
|
148
|
+
### Custom Experiment Types
|
149
|
+
|
150
|
+
When using AMS-BP as a library, you can create custom experiment types by:
|
151
|
+
|
152
|
+
1. Extending the base experiment class
|
153
|
+
2. Implementing custom scanning patterns
|
154
|
+
3. Defining new molecule behaviors
|
155
|
+
4. Creating specialized analysis routines
|
156
|
+
|
157
|
+
## Tips and Best Practices
|
158
|
+
|
159
|
+
1. **Configuration Management**
|
160
|
+
- Keep separate config files for different experiment types
|
161
|
+
- Version control your configurations
|
162
|
+
- Document any custom modifications
|
163
|
+
|
164
|
+
2. **Resource Usage**
|
165
|
+
- Monitor memory usage for large simulations
|
166
|
+
- Use appropriate sampling rates
|
167
|
+
|
168
|
+
3. **Data Output**
|
169
|
+
- Set appropriate output paths
|
170
|
+
- Use meaningful naming conventions
|
171
|
+
- Consider data format requirements for analysis
|
172
|
+
|
173
|
+
## Troubleshooting
|
174
|
+
|
175
|
+
Common issues and their solutions:
|
176
|
+
TODO
|
@@ -41,10 +41,18 @@ class MoleculeParameters(BaseModel)
|
|
41
41
|
- Description: Diffusion coefficients in μm²/s
|
42
42
|
- 2D array automatically converted to numpy array
|
43
43
|
|
44
|
+
- `diffusion_track_amount: List[List[float]]`
|
45
|
+
- Description: Amount of diffusive tracking for each state
|
46
|
+
- 2D array automatically converted to numpy array
|
47
|
+
|
44
48
|
- `hurst_exponent: List[List[float]]`
|
45
49
|
- Description: Hurst exponents for fractional Brownian motion
|
46
50
|
- 2D array automatically converted to numpy array
|
47
51
|
|
52
|
+
- `hurst_track_amount: List[List[float]]`
|
53
|
+
- Description: Amount of Hurst tracking for each state
|
54
|
+
- 2D array automatically converted to numpy array
|
55
|
+
|
48
56
|
- `allow_transition_probability: List[bool]`
|
49
57
|
- Description: Whether to allow state transitions
|
50
58
|
|
@@ -99,24 +107,23 @@ class CondensateParameters(BaseModel)
|
|
99
107
|
```
|
100
108
|
|
101
109
|
#### Fields
|
102
|
-
|
103
|
-
- `initial_centers: List[List[List[float]]]`
|
110
|
+
- `initial_centers: List[List[float]]`
|
104
111
|
- Description: Initial centers in micrometers
|
105
112
|
- 2D array automatically converted to numpy array
|
106
113
|
|
107
|
-
- `initial_scale: List[
|
114
|
+
- `initial_scale: List[float]`
|
108
115
|
- Description: Initial scale in micrometers
|
109
116
|
- Automatically converted to numpy array
|
110
117
|
|
111
|
-
- `diffusion_coefficient: List[
|
118
|
+
- `diffusion_coefficient: List[float]`
|
112
119
|
- Description: Diffusion coefficients in μm²/s
|
113
120
|
- Automatically converted to numpy array
|
114
121
|
|
115
|
-
- `hurst_exponent: List[
|
122
|
+
- `hurst_exponent: List[float]`
|
116
123
|
- Description: Hurst exponents for motion
|
117
124
|
- Automatically converted to numpy array
|
118
125
|
|
119
|
-
- `density_dif:
|
126
|
+
- `density_dif: int`
|
120
127
|
- Description: Density difference parameter
|
121
128
|
|
122
129
|
### OutputParameters
|
@@ -183,11 +190,11 @@ config = ConfigList(
|
|
183
190
|
oversample_motion_time=10
|
184
191
|
),
|
185
192
|
CondensateParameters=CondensateParameters(
|
186
|
-
initial_centers=[[
|
187
|
-
initial_scale=[
|
188
|
-
diffusion_coefficient=[
|
189
|
-
hurst_exponent=[
|
190
|
-
density_dif=
|
193
|
+
initial_centers=[[5.0, 5.0]],
|
194
|
+
initial_scale=[2.0],
|
195
|
+
diffusion_coefficient=[0.1],
|
196
|
+
hurst_exponent=[0.7],
|
197
|
+
density_dif=2
|
191
198
|
),
|
192
199
|
OutputParameters=OutputParameters(
|
193
200
|
output_path="./output",
|
@@ -201,4 +208,4 @@ config = ConfigList(
|
|
201
208
|
## Dependencies
|
202
209
|
- `pydantic`: For data validation and settings management
|
203
210
|
- `numpy`: For array operations
|
204
|
-
- `typing`: For type hints
|
211
|
+
- `typing`: For type hints
|
@@ -108,13 +108,13 @@ Creates sample plane from parameters.
|
|
108
108
|
|
109
109
|
### `make_condensatedict`
|
110
110
|
```python
|
111
|
-
def make_condensatedict(condensate_params, cell) ->
|
111
|
+
def make_condensatedict(condensate_params, cell) -> dict
|
112
112
|
```
|
113
|
-
Creates condensate
|
113
|
+
Creates condensate dictionary from parameters.
|
114
114
|
- **Parameters:**
|
115
115
|
- `condensate_params`: Condensate parameters
|
116
116
|
- `cell`: Cell instance
|
117
|
-
- **Returns:** Condensate
|
117
|
+
- **Returns:** Condensate dictionary
|
118
118
|
|
119
119
|
### `get_tracks`
|
120
120
|
```python
|
@@ -12,35 +12,14 @@ 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)
|
16
15
|
|
17
16
|
---
|
18
17
|
|
19
18
|
## Classes
|
20
19
|
|
21
20
|
### `PSFParameters`
|
22
|
-
|
23
|
-
|
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`
|
21
|
+
|
22
|
+
|
44
23
|
#### Methods
|
45
24
|
|
46
25
|
- **`__init__`**: Initializes the PSF engine with the given parameters.
|
@@ -50,7 +29,6 @@ def pinhole_radius(self) -> Optional[float]:
|
|
50
29
|
- **`_3d_normalization_A`**: Computes the normalization factor for a 3D Gaussian PSF.
|
51
30
|
- **`_2d_normalization_A`**: Computes the normalization factor for a 2D Gaussian PSF.
|
52
31
|
- **`normalize_psf`**: Normalizes the PSF using different schemes.
|
53
|
-
- **`_generate_pinhole_mask`**: Generate a binary mask representing the pinhole's spatial filtering.
|
54
32
|
|
55
33
|
---
|
56
34
|
|
@@ -127,21 +105,4 @@ Calculates the appropriate PSF size based on physical parameters.
|
|
127
105
|
|
128
106
|
#### Returns
|
129
107
|
|
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.
|
108
|
+
- **`Tuple[int, ...]`**: Tuple of dimensions (z, y, x) or (y, x) for the PSF calculation.
|
@@ -122,24 +122,24 @@ This document provides a detailed explanation of the TOML configuration file use
|
|
122
122
|
## 5. **Condensate Parameters**
|
123
123
|
|
124
124
|
### `initial_centers`
|
125
|
-
- **Type**: Array of
|
126
|
-
- **Shape**: `[[
|
127
|
-
- **Description**: The initial centers of condensates in micrometers (`um`).
|
125
|
+
- **Type**: Array of Arrays of Numbers
|
126
|
+
- **Shape**: `[[x, y, z], ...]`
|
127
|
+
- **Description**: The initial centers of condensates in micrometers (`um`).
|
128
128
|
|
129
129
|
### `initial_scale`
|
130
|
-
- **Type**: Array of
|
130
|
+
- **Type**: Array of Numbers
|
131
131
|
- **Description**: The initial scale of condensates in micrometers (`um`).
|
132
132
|
|
133
133
|
### `diffusion_coefficient`
|
134
|
-
- **Type**: Array of
|
134
|
+
- **Type**: Array of Numbers
|
135
135
|
- **Description**: The diffusion coefficients of condensates in `um^2/s`.
|
136
136
|
|
137
137
|
### `hurst_exponent`
|
138
|
-
- **Type**: Array of
|
138
|
+
- **Type**: Array of Numbers
|
139
139
|
- **Description**: The Hurst exponents of condensates.
|
140
140
|
|
141
141
|
### `density_dif`
|
142
|
-
- **Type**:
|
142
|
+
- **Type**: Number
|
143
143
|
- **Description**: The density difference between the condensate and the background.
|
144
144
|
|
145
145
|
---
|
@@ -224,7 +224,6 @@ 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.
|
228
227
|
|
229
228
|
---
|
230
229
|
|
@@ -1,8 +1,5 @@
|
|
1
1
|
# AMS-BP User Guide
|
2
|
-
|
3
|
-
<img src="assets/icons/drawing.svg" alt="AMS-BP Logo" width="500" height="200">
|
4
|
-
</p>
|
5
|
-
## Advanced Fluorescence Microscopy Simulation Tool
|
2
|
+
## Advanced Molecule Simulation Tool
|
6
3
|
|
7
4
|
AMS-BP is a powerful simulation tool for advanced fluorescence microscopy experiments. This guide covers both command-line usage and library integration.
|
8
5
|
|
@@ -3,7 +3,7 @@ name = "AMS_BP"
|
|
3
3
|
|
4
4
|
dynamic = ["version"]
|
5
5
|
|
6
|
-
description = "Advanced Microscopy Simulations developed for the Weber Lab by Baljyot Singh Parmar"
|
6
|
+
description = "Advanced Molecule Simulations and Microscopy Simulations developed for the Weber Lab by Baljyot Singh Parmar"
|
7
7
|
|
8
8
|
readme = "README.md"
|
9
9
|
|
@@ -22,6 +22,7 @@ maintainers = [
|
|
22
22
|
|
23
23
|
dependencies = [
|
24
24
|
"numpy>=1.21.2",
|
25
|
+
"matplotlib>=3.6.0",
|
25
26
|
"scipy>=1.7.1",
|
26
27
|
"scikit-image>=0.18.3",
|
27
28
|
"typer>=0.12.5",
|
@@ -40,10 +41,8 @@ venv = ".venv"
|
|
40
41
|
|
41
42
|
[tool.uv]
|
42
43
|
dev-dependencies = [
|
43
|
-
"matplotlib>=3.10.0",
|
44
44
|
"mkdocs-material==9.5.40",
|
45
45
|
"mkdocstrings-python>=1.12.2",
|
46
|
-
"notebook>=7.3.2",
|
47
46
|
"pymdown-extensions>=10.11",
|
48
47
|
"pyright>=1.1.384",
|
49
48
|
"pytest>=8.3.3",
|
@@ -21,7 +21,9 @@ class MoleculeParameters(BaseModel):
|
|
21
21
|
diffusion_coefficient: List[List[float]] = Field(
|
22
22
|
description="Diffusion coefficients in um^2/s"
|
23
23
|
)
|
24
|
+
diffusion_track_amount: List[List[float]]
|
24
25
|
hurst_exponent: List[List[float]]
|
26
|
+
hurst_track_amount: List[List[float]]
|
25
27
|
allow_transition_probability: List[bool]
|
26
28
|
transition_matrix_time_step: List[int] = Field(description="Time step in ms")
|
27
29
|
diffusion_transition_matrix: List[List[List[float]]]
|
@@ -31,7 +33,9 @@ class MoleculeParameters(BaseModel):
|
|
31
33
|
|
32
34
|
@field_validator(
|
33
35
|
"diffusion_coefficient",
|
36
|
+
"diffusion_track_amount",
|
34
37
|
"hurst_exponent",
|
38
|
+
"hurst_track_amount",
|
35
39
|
"state_probability_diffusion",
|
36
40
|
"state_probability_hurst",
|
37
41
|
)
|
@@ -56,22 +60,19 @@ class GlobalParameters(BaseModel):
|
|
56
60
|
|
57
61
|
|
58
62
|
class CondensateParameters(BaseModel):
|
59
|
-
initial_centers: List[List[
|
60
|
-
|
61
|
-
|
62
|
-
initial_scale: List[List[float]] = Field(description="Initial scale in um")
|
63
|
-
diffusion_coefficient: List[List[float]] = Field(
|
63
|
+
initial_centers: List[List[float]] = Field(description="Initial centers in um")
|
64
|
+
initial_scale: List[float] = Field(description="Initial scale in um")
|
65
|
+
diffusion_coefficient: List[float] = Field(
|
64
66
|
description="Diffusion coefficients in um^2/s"
|
65
67
|
)
|
66
|
-
hurst_exponent: List[
|
67
|
-
density_dif:
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
#
|
68
|
+
hurst_exponent: List[float]
|
69
|
+
density_dif: int
|
70
|
+
|
71
|
+
@field_validator(
|
72
|
+
"initial_centers", "initial_scale", "diffusion_coefficient", "hurst_exponent"
|
73
|
+
)
|
74
|
+
def convert_to_array(cls, v):
|
75
|
+
return np.array(v)
|
75
76
|
|
76
77
|
|
77
78
|
class OutputParameters(BaseModel):
|
@@ -324,12 +324,11 @@ class ConfigLoader:
|
|
324
324
|
):
|
325
325
|
# Create PSFParameters instance
|
326
326
|
parameters = PSFParameters(
|
327
|
-
|
327
|
+
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),
|
333
332
|
)
|
334
333
|
|
335
334
|
# Create PSF engine
|
@@ -681,7 +680,7 @@ class ConfigLoader:
|
|
681
680
|
)
|
682
681
|
|
683
682
|
# make sampling function
|
684
|
-
|
683
|
+
sampling_function = make_samplingfunction(
|
685
684
|
condensate_params=base_config.CondensateParameters, cell=cell
|
686
685
|
)
|
687
686
|
|
@@ -690,7 +689,7 @@ class ConfigLoader:
|
|
690
689
|
molecule_params=base_config.MoleculeParameters,
|
691
690
|
cell=cell,
|
692
691
|
condensate_params=base_config.CondensateParameters,
|
693
|
-
|
692
|
+
sampling_function=sampling_function,
|
694
693
|
)
|
695
694
|
|
696
695
|
# create the track generator
|
@@ -777,42 +776,34 @@ def make_sample(global_params, cell_params) -> SamplePlane:
|
|
777
776
|
return sample_plane
|
778
777
|
|
779
778
|
|
780
|
-
def make_condensatedict(condensate_params, cell) ->
|
781
|
-
condensates_dict =
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
hurst_exponent=condensate_params.hurst_exponent[i],
|
789
|
-
cell=cell,
|
790
|
-
)
|
791
|
-
)
|
779
|
+
def make_condensatedict(condensate_params, cell) -> dict:
|
780
|
+
condensates_dict = create_condensate_dict(
|
781
|
+
initial_centers=condensate_params.initial_centers,
|
782
|
+
initial_scale=condensate_params.initial_scale,
|
783
|
+
diffusion_coefficient=condensate_params.diffusion_coefficient,
|
784
|
+
hurst_exponent=condensate_params.hurst_exponent,
|
785
|
+
cell=cell,
|
786
|
+
)
|
792
787
|
return condensates_dict
|
793
788
|
|
794
789
|
|
795
|
-
def make_samplingfunction(condensate_params, cell) ->
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
cell=cell,
|
805
|
-
)
|
806
|
-
)
|
807
|
-
return sampling_functions
|
790
|
+
def make_samplingfunction(condensate_params, cell) -> Callable:
|
791
|
+
sampling_function = tp(
|
792
|
+
num_subspace=len(condensate_params.initial_centers),
|
793
|
+
subspace_centers=condensate_params.initial_centers,
|
794
|
+
subspace_radius=condensate_params.initial_scale,
|
795
|
+
density_dif=condensate_params.density_dif,
|
796
|
+
cell=cell,
|
797
|
+
)
|
798
|
+
return sampling_function
|
808
799
|
|
809
800
|
|
810
|
-
def gen_initial_positions(molecule_params, cell, condensate_params,
|
801
|
+
def gen_initial_positions(molecule_params, cell, condensate_params, sampling_function):
|
811
802
|
initials = []
|
812
803
|
for i in range(len(molecule_params.num_molecules)):
|
813
804
|
num_molecules = molecule_params.num_molecules[i]
|
814
805
|
initial_positions = gen_points(
|
815
|
-
pdf=
|
806
|
+
pdf=sampling_function,
|
816
807
|
total_points=num_molecules,
|
817
808
|
min_x=cell.origin[0],
|
818
809
|
max_x=cell.origin[0] + cell.dimensions[0],
|
@@ -820,7 +811,7 @@ def gen_initial_positions(molecule_params, cell, condensate_params, sampling_fun
|
|
820
811
|
max_y=cell.origin[1] + cell.dimensions[1],
|
821
812
|
min_z=-cell.dimensions[2] / 2,
|
822
813
|
max_z=cell.dimensions[2] / 2,
|
823
|
-
density_dif=condensate_params.density_dif
|
814
|
+
density_dif=condensate_params.density_dif,
|
824
815
|
)
|
825
816
|
initials.append(initial_positions)
|
826
817
|
return initials
|
@@ -1,4 +1,4 @@
|
|
1
|
-
from typing import
|
1
|
+
from typing import 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
|
-
Channel: Dict[Literal["Name"], List[str]]
|
80
|
+
# Channel: Dict[Literal["Name"], List[str]]
|
81
81
|
|
82
82
|
def __post_init__(self):
|
83
83
|
if isinstance(self.notes, (list, str)):
|
@@ -20,6 +20,7 @@ Usage:
|
|
20
20
|
condensate(times, time_unit) -> dict{"Position":np.ndarray, "Scale":float}
|
21
21
|
"""
|
22
22
|
|
23
|
+
import matplotlib.pyplot as plt
|
23
24
|
import numpy as np
|
24
25
|
|
25
26
|
from ..cells.rectangular_cell import RectangularCell
|
@@ -309,3 +310,47 @@ class Condensate:
|
|
309
310
|
# make array of length time with the last scale
|
310
311
|
scale = np.full(time.shape, last_scale)
|
311
312
|
return scale
|
313
|
+
|
314
|
+
def plot_condensate(self, ax, **kwargs):
|
315
|
+
"""
|
316
|
+
Plots the condensate
|
317
|
+
|
318
|
+
Parameters:
|
319
|
+
-----------
|
320
|
+
ax: plt.Axes
|
321
|
+
Axes to plot the condensate on.
|
322
|
+
**kwargs:
|
323
|
+
Keyword arguments to pass to the plot function.
|
324
|
+
"""
|
325
|
+
# check if the _condensate_positions exists
|
326
|
+
if not hasattr(self, "_condensate_positions"):
|
327
|
+
# if it doesn't then we need to generate the condensate positions
|
328
|
+
self.times = np.array([self.initial_time])
|
329
|
+
self.condensate_positions = np.array([self.initial_position])
|
330
|
+
self.scale = np.array([self.initial_scale])
|
331
|
+
|
332
|
+
# plot the condensate positions
|
333
|
+
ax.plot(
|
334
|
+
self.condensate_positions[:, 0], self.condensate_positions[:, 1], **kwargs
|
335
|
+
)
|
336
|
+
|
337
|
+
# plot a circle at all the positions with the scale as the radius
|
338
|
+
for i in range(len(self.condensate_positions)):
|
339
|
+
ax.add_patch(
|
340
|
+
plt.Circle(
|
341
|
+
self.condensate_positions[i], self.scale[i], color="r", fill=False
|
342
|
+
)
|
343
|
+
)
|
344
|
+
|
345
|
+
# plot the initial position in a different colour
|
346
|
+
ax.scatter(self.initial_position[0], self.initial_position[1], color="g")
|
347
|
+
# plot the final position in a different colour
|
348
|
+
ax.scatter(
|
349
|
+
self.condensate_positions[-1][0],
|
350
|
+
self.condensate_positions[-1][1],
|
351
|
+
color="b",
|
352
|
+
)
|
353
|
+
if "save_path" in kwargs:
|
354
|
+
plt.savefig(kwargs["save_path"])
|
355
|
+
# plt.show()
|
356
|
+
return ax
|