Skip to main content

muscopy

Documentation Status

muscopy is a Python library for label-free microscopy analysis, such as quantitative phase imaging (QPI), digital holography, optical diffraction tomography, intensity diffraction tomography, phasor analysis, and related workflows. The package has been developed and maintained by the Ideguchi-Lab at the University of Tokyo, Japan.

How to install

Install from PyPI (Python 3.11–3.14).

pip install muscopy

For a compatible NVIDIA GPU and CUDA 12 environment:

pip install "muscopy[cuda]"

For source development, clone the repository and use uv.

git clone https://github.com/Ideguchi-Lab/muscopy.git
cd muscopy
uv sync

If you are willing to contribute, install the development dependencies.

uv sync --extra dev

Install documentation dependencies when building docs locally.

uv sync --extra doc

Generate example holograms

Run the installed command to save a synthetic off-axis hologram of a disk phase object and its sample-free reference.

muscopy-generate-hologram holograms.npz

The NumPy archive contains hologram, reference_hologram, off_axis_center, and the five MuParameters fields used by the QPI example. The examples generate their inputs in memory with the bundled example data generators.

Optional CuPy support

Install the CuPy extra for CUDA 12 environments.

uv sync --extra cupy

Import CuPy helpers from muscopy.cuda submodules.

from muscopy.cuda.dh import offaxis_dh
from muscopy.cuda.phase_noise import calc_visibility
from muscopy.cuda.qpi import mip_qpi, qpi
from muscopy.cuda.qpi_utils import unwrap_phase

Optional MLB simulation examples

examples/odt_with_mlb_simulation.py and examples/idt_with_mlb_simulation.py require muscopy-mlbsim, a private package available only to users with access to the Ideguchi-Lab repository. It is not included in muscopy or its PyPI extras. These two examples skip execution when the simulator is unavailable; muscopy's reconstruction APIs and the other examples do not require it.

See the separate MLB installation guide for access requirements, installation commands, and how to run these examples. This replaces the former uv sync --extra extra installation method.

Public API compatibility

For v1.0, muscopy's stable import contract is submodule-based. Import stable functions and classes from their documented modules, for example:

from muscopy.qpi import qpi
from muscopy.odt import ODTConfig, odt
from muscopy.idt import IDTConfig, compute_idt

The stable v1.0 modules are muscopy.cfg, muscopy.dh, muscopy.qpi, muscopy.qpi_utils, muscopy.odt, muscopy.idt, muscopy.phasor, muscopy.phase_noise, and muscopy.dir_parser. Public names listed in each module's __all__ are covered by compatibility guarantees.

muscopy.image_checker is experimental and is not covered by the v1.0 compatibility guarantee. Private names beginning with _, examples, generated documentation files, and implementation constants are also outside the stable API.

After v1.0, removing or changing a stable public API requires a deprecation notice, migration guidance, and a changelog entry before removal in a future major release. Experimental APIs may change with changelog notice.

Linter guide

The linter and type checker configuration is in pyproject.toml.

uv run ruff check ./muscopy ./tests ./examples
uv run ruff format ./muscopy ./tests ./examples
uv run mypy
uv run pyright

Docs

The documentation is hosted on Read the Docs: https://muscopy.readthedocs.io.

You can also build the documentation locally with the following command.

uv sync --extra doc
uv run sphinx-build -W docs/source docs/build

Then, you can find the documentation in docs/build/index.html.

Authors and license

Authors: Masato Fukushima, Kohki Horie, and Takuro Ideguchi.

Copyright (c) 2024–2026 Ideguchi-Lab. Starting with version 1.0.2, muscopy is distributed under the MIT License.

Acknowledgments

We thank Zinan Zhou and Atsuko Price for their contributions to muscopy.

Metadata

Release files for muscopy 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for muscopy 1.1.0
File Size Uploaded Provenance Actions
muscopy-1.1.0.tar.gz 63.8 kB With provenance Details for muscopy-1.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for muscopy 1.1.0
File Interpreter ABI Platform Actions
muscopy-1.1.0-py3-none-any.whl Python 3 none any Details for muscopy-1.1.0-py3-none-any.whl

Total release size: 110.8 kB

Release files / muscopy-1.1.0.tar.gz

Download URL muscopy-1.1.0.tar.gz
Size 63.8 kB
Tags Source
SHA-256 checksum
How to use checksums
e4bb44b8e779b1c6998422adb2c790a4fbc20f9adc4c61fe84a2b121af63894f
BLAKE2b-256 checksum
How to use checksums
9dc38768df8fbe909300e74fb757f1cc05cbf66e9adce2eb539e63af40c5167b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Release files / muscopy-1.1.0-py3-none-any.whl

Download URL muscopy-1.1.0-py3-none-any.whl
Size 47.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
162dc8d9526e90265690409f1ebf1dc3030b5e6332855bfe410a30b5b44c3827
BLAKE2b-256 checksum
How to use checksums
789ed59c40f24349bf89e2eac96a4683b1188af26b27d63133b3bce720474135
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

Security for muscopy 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for muscopy-1.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page