Light microscopy simulation in python
Project description
microsim
Light microscopy simulation in python.
The goal of this library is to generate highly realistic simulated data such as the following:
(this data was generated using segmentations from cell jrc_hela-3 at OpenOrganelle as the ground truth)
https://github.com/user-attachments/assets/905fa1af-c8bd-406e-87a7-7c5921de74d1
Documentation
Start with the tutorial, and read about the
simulation stages, then see the
API Reference for details
on the Simulation object and options for all of the fields.
Installation
from PyPI
pip install "microsim[all]"
[!NOTE] At the moment, this library is a bit more "application" than it is "library". If you are following the docs or tutorials, its probably best to install the full
[all]extra, which brings in io, visualization, and other data-fetching dependencies. However, the bare minimal install is fully functional for generating data.
Local Development
gh repo clone tlambert03/microsim
cd microsim
uv sync
From github
To get the bleeding edge version, which will change rapidly, you can install from github.
pip install "microsim[all] @ git+https://github.com/tlambert03/microsim"
With GPU support
If available, microsim can use either Jax or Cupy to accelerate computations. These are not installed by default, see the jax or cupy installation instructions, paying attention to your GPU requirements. Support for torch is planned.
Usage
Construct and run a
microsim.Simulation
object.
from microsim import schema as ms
from microsim.util import ortho_plot
# define the parameters of the simulation
sim = ms.Simulation(
truth_space=ms.ShapeScaleSpace(shape=(128, 512, 512), scale=(0.02, 0.01, 0.01)),
output_space={'downscale': 8},
sample=ms.Sample(
labels=[ms.MatsLines(density=0.5, length=30, azimuth=5, max_r=1)]
),
modality=ms.Confocal(pinhole_au=0.2),
output_path="au02.tiff",
)
# run it
result = sim.run()
# optionally plot the result
ortho_plot(result)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file microsim-0.0.12.post0.tar.gz.
File metadata
- Download URL: microsim-0.0.12.post0.tar.gz
- Upload date:
- Size: 4.5 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d845676300e1d99be43d274ded5f0e1ec50c3e03ea59725359a387d24bc3eec3
|
|
| MD5 |
ff47558277396cb10e188ec865e767c5
|
|
| BLAKE2b-256 |
62c197caa3b53d1f2b23e103439bb2c41175fa0a0545c1a863e04b19c5496597
|
Provenance
The following attestation bundles were made for microsim-0.0.12.post0.tar.gz:
Publisher:
ci.yml on tlambert03/microsim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
microsim-0.0.12.post0.tar.gz -
Subject digest:
d845676300e1d99be43d274ded5f0e1ec50c3e03ea59725359a387d24bc3eec3 - Sigstore transparency entry: 1076496625
- Sigstore integration time:
-
Permalink:
tlambert03/microsim@9ce80410bbe56f9dabaf124947b59faf89b7e336 -
Branch / Tag:
refs/tags/v0.0.12.post0 - Owner: https://github.com/tlambert03
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@9ce80410bbe56f9dabaf124947b59faf89b7e336 -
Trigger Event:
push
-
Statement type:
File details
Details for the file microsim-0.0.12.post0-py3-none-any.whl.
File metadata
- Download URL: microsim-0.0.12.post0-py3-none-any.whl
- Upload date:
- Size: 105.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ddb8130c6a25d3d8279cf9ee5f3ff7264fd6e86dfc4119562c1bf556733ef80a
|
|
| MD5 |
3491e8cf6f85aa4196d0881c08e7ac9d
|
|
| BLAKE2b-256 |
ca5d95f4515f13d49bc5e0b2cd65539c74cd6855caeea6fa6ae3a15b493fb796
|
Provenance
The following attestation bundles were made for microsim-0.0.12.post0-py3-none-any.whl:
Publisher:
ci.yml on tlambert03/microsim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
microsim-0.0.12.post0-py3-none-any.whl -
Subject digest:
ddb8130c6a25d3d8279cf9ee5f3ff7264fd6e86dfc4119562c1bf556733ef80a - Sigstore transparency entry: 1076496639
- Sigstore integration time:
-
Permalink:
tlambert03/microsim@9ce80410bbe56f9dabaf124947b59faf89b7e336 -
Branch / Tag:
refs/tags/v0.0.12.post0 - Owner: https://github.com/tlambert03
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
ci.yml@9ce80410bbe56f9dabaf124947b59faf89b7e336 -
Trigger Event:
push
-
Statement type: