Skip to main content

Light microscopy simulation in python

Project description

microsim

License PyPI Python Version CI codecov

Light microscopy simulation in python

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

See the API Reference (https://tlambert03.github.io/microsim/api/) 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.1.tar.gz (1.4 MB view details)

Uploaded Source

Built Distribution

microsim-0.0.1-py3-none-any.whl (53.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: microsim-0.0.1.tar.gz
  • Upload date:
  • Size: 1.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for microsim-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bb5c1359b13583799531f9862e54deee9b10934faa7bb2f45c040220352add25
MD5 827df61be44bf78600beec2a9ae24c91
BLAKE2b-256 e2fdcff150b4ce64029d9866e707b3d9f0ad76f7716b431fa2b5fb0babdbce57

See more details on using hashes here.

File details

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

File metadata

  • Download URL: microsim-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 53.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.0.0 CPython/3.12.3

File hashes

Hashes for microsim-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8506b2ccb7ac34f9c71502577af9787c867d2f28af5b9ce9da18af6e26cb0b9e
MD5 148cdb60d91f816d03409202166a556e
BLAKE2b-256 d1668d5bd5502a520dd9d377c4926e53bd0d59b3d3d2ae3aa6809b316d765cdc

See more details on using hashes here.

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