Skip to main content

Light microscopy simulation in python

Project description

microsim

License PyPI Python Version CI codecov

Light microscopy simulation in python.

The goal of this library is to generate highly realistic simulated data such as the following:

Montage2

(this data was generated using segmentations from cell jrc_hela-3 at OpenOrganelle as the ground truth)

Installation

from PyPI

pip install microsim

from github

To get the bleeding edge version, which will change rapidly, you can install from github.

pip install git+https://github.com/tlambert03/microsim

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)

Documentation

Start with the tutorial, then see the API Reference for details on the Simulation object and options for all of the fields.

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

microsim-0.0.8.tar.gz (4.3 MB view details)

Uploaded Source

Built Distribution

microsim-0.0.8-py3-none-any.whl (104.6 kB view details)

Uploaded Python 3

File details

Details for the file microsim-0.0.8.tar.gz.

File metadata

  • Download URL: microsim-0.0.8.tar.gz
  • Upload date:
  • Size: 4.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for microsim-0.0.8.tar.gz
Algorithm Hash digest
SHA256 7ffe63b44b33a37c67065c1cd79b9045c0749ac882896519b0928f910a90c08d
MD5 0ced3fb00d550401eaf4674fe3ebd69c
BLAKE2b-256 8e76ff4828e7c3f47df9b9b9b99df628c5e01112db1c0c1a687787b031e7f5e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for microsim-0.0.8.tar.gz:

Publisher: ci.yml on tlambert03/microsim

Attestations:

File details

Details for the file microsim-0.0.8-py3-none-any.whl.

File metadata

  • Download URL: microsim-0.0.8-py3-none-any.whl
  • Upload date:
  • Size: 104.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for microsim-0.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b1b01e1cd4e4396289efceefa8b86bb969b390b76c048b46f61bc126a994af23
MD5 5c3495d46b87d5cf33577d0374525659
BLAKE2b-256 236f5be457df034e8528cf794a3162edd786bc393fab03d82d7dac4c2270a1df

See more details on using hashes here.

Provenance

The following attestation bundles were made for microsim-0.0.8-py3-none-any.whl:

Publisher: ci.yml on tlambert03/microsim

Attestations:

Supported by

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