Python Usage¶
When using VLab4Mic as a Python library, you get full programmatic control over every step of the simulation.
First make sure you have installed VLab4Mic in your virtual environment.
Option 1 — Run Scripts from the Command Line¶
Write your simulation in a Python script and run it from the command line:
Here is a minimal script that runs an imaging simulation:
from vlab4mic.experiments import image_vsample
images, noiseless, experiment = image_vsample(run_simulation=True)
For more complete examples, see the Examples page.
Option 2 — Interactive Python Interpreter¶
Start an interactive Python session:
Then use VLab4Mic interactively:
>>> from vlab4mic.experiments import image_vsample
>>> images, noiseless, experiment = image_vsample(run_simulation=True)
Getting Help¶
Use Python's built-in help() to explore the available parameters for any function:
Next Steps¶
-
:material-function:{ .lg .middle } Methods Reference
Detailed usage guide for
image_vsampleandrun_parameter_sweep. -
:material-table:{ .lg .middle } Parameter Reference
Complete list of all parameters available for simulation and sweeps.
-
:material-code-tags:{ .lg .middle } Example Scripts
Browse ready-to-run example scripts covering common use cases.