Skip to main content

VLab4Mic: A virtual laboratory for microscopy simulation and validation

Project description

VLab4Mic: A Virtual Laboratory for Microscopy

A friendly toolkit to help researchers simulate fluorescence microscopy images, no coding required.

PyPI Python Version Downloads Documentation License Tests Coverage Contributors GitHub stars GitHub forks

VLab4Mic lets you explore, test, and validate imaging experiments before stepping into the microscope room.
Whether you are new to Python or an experienced bioimage researcher, VLab4Mic provides a safe sandbox to:

  • Build virtual samples from PDB/CIF structures
  • Apply direct or indirect fluorescent labeling
  • Introduce Structural integrity, crowding, and structural variation
  • Simulate image acquisition across modalities
  • Run parameter sweeps to explore experimental conditions
  • Compare noiseless vs. realistic acquisitions

This README is written to be friendly for beginners while maintaining the technical depth experienced users expect.

Who Is This Tool For?

  • New microscopy users: to gain intuitive understanding without coding
  • Researchers designing experiments: testing probes, PSFs, exposure times
  • Microscopy experts: benchmarking reconstruction methods or PSFs

🚀 Quick Start Options

Option Skills Needed Best For
1. Google Colab None Beginners, teaching, quick experiments
2. Local Jupyter Notebooks Basic installation Smooth widget-based use
3. Python Scripts Comfortable with code Full flexibility & automation

🟢 Option 1 — Google Colab (No Installation Needed)

The easiest way to start.

✔ No installation
✔ No configuration
✔ Works in browser
✔ Always up to date

👉 Click to open the main notebook:

Category Description Notebook Colab
Main Interface Create virtual samples & simulate imaging Notebook Open in Colab
Parameter Sweeps Configure & run simulation sweeps Notebook Open in Colab

Video Tutorials

Tutorial Video
Tutorial 1 Watch Tutorial 1
Tutorial 2 Watch Tutorial 2
Tutorial 3 Watch Tutorial 3

If the Colab link fails:

  1. Click the Jupyter badge (opens the raw notebook)
  2. Download the .ipynb file
  3. Open Google Colab → File → Upload notebook

🔵 Option 2 — Local Installation (Beginner-Friendly)

1️⃣ Create a virtual environment

We recommend using Python's built-in venv. Conda or a similar environment manager can also be used if you prefer.

Using venv:

Run the following command to create a local .venv environment:

python3 -m venv .venv

Then activate it:

source .venv/bin/activate

2️⃣ Install VLab4Mic and its associated library to use the codeless jupyter notebooks

pip install vlab4mic "vlab4micjupyter[local]"

VLab4Mic downloads required PDB/CIF structure files on first use and stores them in your user folder at ~/.vlab4mic/structures. To use a different location, set VLAB4MIC_STRUCTURE_DIR before running VLab4Mic.


3️⃣ Launch Jupyter Lab

jupyter lab

4️⃣ Download and open notebooks

From:
https://github.com/HenriquesLab/VLab4Mic/tree/main/notebooks


🔴 Option 3 — Use VLab4Mic as a Python Library (Advanced)

Example script:

from vlab4mic.experiments import image_vsample
import matplotlib.pyplot as plt

modalities = ["Widefield", "Confocal", "STED"]

images, noiseless, experiment = image_vsample(
    structure="7R5K",
    probe_template="Antibody",
    probe_target_type="Sequence",
    probe_target_value="ELAVGSL",
    multimodal=modalities,
    number_of_particles=10,
    run_simulation=True,
)

fig, axs = plt.subplots(1, len(modalities))
for i, mod in enumerate(modalities):
    axs[i].imshow(images[mod][0], cmap="magma")
    axs[i].set_title(mod)
plt.show()

For more examples see /examples.


Documentation & Manual


Core Features

✔ Structural modelling

✔ Virtual sample creation

✔ Imaging simulations

✔ Parameter sweeps

✔ Widget-based GUI

✔ Flexible Python API


Troubleshooting

Jupyter won't open → Environment not activated.
ImportError → Install VLab4Mic inside the active environment.
Colab won't load → Upload notebook manually.

If issues persist, open an issue!


Contributing

Contributions welcome!
See: https://github.com/HenriquesLab/VLab4Mic/blob/main/CONTRIBUTING.md

Support

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

vlab4mic-0.1.0.tar.gz (123.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vlab4mic-0.1.0-py3-none-any.whl (137.8 kB view details)

Uploaded Python 3

File details

Details for the file vlab4mic-0.1.0.tar.gz.

File metadata

  • Download URL: vlab4mic-0.1.0.tar.gz
  • Upload date:
  • Size: 123.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vlab4mic-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a002db4925fd1904e94b19743f3818b1aadc03c4da48d291a275b461db2f8f14
MD5 f85b9f5298adb395b843366292f3dc21
BLAKE2b-256 f0ce8a629d53a223f711febaa196d61413b8c5b58cdbec31d17dbfe3b6c8492a

See more details on using hashes here.

File details

Details for the file vlab4mic-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: vlab4mic-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 137.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vlab4mic-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cb03b839826bf39e679ed5e82caa576322b2c66d0b4ec77b72a2a355584264bc
MD5 19af61e16bf8dfb54b5b907af9a6fac8
BLAKE2b-256 4801ce9da9d797f39fce57f811167cfbf3a105fc51ee953c761ac7cccce2779a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page