Skip to main content

A python package for background and shading correction of optical microscopy images

Project description

BaSiCPy

A python package for background and shading correction of optical microscopy images License Python Version PyPI

All Contributors

BaSiCPy is a python package for background and shading correction of optical microscopy images. It is developed based on the Matlab version of BaSiC tool.

Reference: A BaSiC Tool for Background and Shading Correction of Optical Microscopy Images

by Tingying Peng, Kurt Thorn, Timm Schroeder, Lichao Wang, Fabian J Theis, Carsten Marr*, Nassir Navab*, Nature Communication 8:14836 (2017). doi: 10.1038/ncomms14836.

Simple examples

Notebook Description Colab Link
timelapse_brightfield 100 continuous brightfield frames of a time-lapse movie of differentiating mouse hematopoietic stem cells. Open In Colab
timelapse_nanog 189 continuous fluorescence frames of a time-lapse movie of differentiating mouse embryonic stem cells, which move much more slower compared to the fast moving hematopoietic stem cells, resulting in a much larger correlation between frames. Note that in this challenging case, the automatic parameters are no longer optimal, so we use the manual parameter setting (larger smooth regularization on both flat-field and dark-field) to improve BaSiC’s performance. Open In Colab
WSI_brain you can stitch image tiles together to view the effect of shading correction Open In Colab

You can also find examples of running the package at folder Notebooks. Data used in the examples and a description can be downloaded from Zenodo.


Installation

Download from PyPI

pip install 'PACKAGE-NAME'

or install latest development version

git clone https://github.com/peng-lab/BaSiCPy.git
cd BaSiCPy
pip install .

Recommended: use virtual environment

$ cd BaSiCPy
$ python -m venv venv
$ source venv/bin/activate
(venv) $ pip install -e .

Install with dev dependencies

git clone https://github.com/peng-lab/BaSiCPy.git
cd BaSiCPy
python -m venv venv
source venv/bin/activate
pip install -e '.[dev]'

Development

bump2version

This repository uses bump2version to manage dependencies. New releases are pushed to PyPi in the CI pipeline when a new version is committed with a version tag and pushed to the repo.

The development flow should use the following process:

  1. New features and bug fixes should be pushed to dev
  2. When tests have passed a new development version is ready to be release, use bump2version major|minor|patch. This will commit and create a new version tag with the -dev suffix.
  3. Additional fixes/features can be added to the current development release by using bump2version build.
  4. Once the new bugs/features have been tested and a main release is ready, use bump2version release to remove the -dev suffix.

After creating a new tagged version, push to Github and the version will be built and pushed to PyPi.

Contributors

Current version


Nicholas-Schaub

💻 ⚠️ 👀 🤔 📆

Tim Morello

👀 ⚠️ 🤔 💻

Tingying Peng

💻 🔣 💵 📢

Yohsuke T. Fukai

💻 🔬 💬 ⚠️ 🤔
  • Nicholas Schaub (@Nicholas-Schaub)
    • General mentoring, technology selection and project management
    • Designing and implementing core structure of the package
    • Code review and advising
    • Providing tests
  • Tim Morello (@tdmorello)
    • Designing and implementing core structure of the package
    • Providing tests
    • Code review
  • Tingying Peng (@tying84)
    • General comments and financial support
    • Reviewing theoretical calculation
    • Providing a JAX implementation for the approximate fitting routine
    • Providing test data and commenting on expected output
  • Yohsuke T. Fukai (@yfukai)
    • Theoretical calculation for the optimization problem
    • Implementation of the main fitting routine
    • Providing tests
    • Code review

Old version (f3fcf19), used as the reference implementation to check the approximate algorithm

  • Lorenz Lamm (@LorenzLamm)
  • Mohammad Mirkazemi (@Mirkazemi)

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

BaSiCPy-0.2.0.dev2.tar.gz (18.8 kB view details)

Uploaded Source

Built Distribution

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

BaSiCPy-0.2.0.dev2-py3-none-any.whl (21.3 kB view details)

Uploaded Python 3

File details

Details for the file BaSiCPy-0.2.0.dev2.tar.gz.

File metadata

  • Download URL: BaSiCPy-0.2.0.dev2.tar.gz
  • Upload date:
  • Size: 18.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for BaSiCPy-0.2.0.dev2.tar.gz
Algorithm Hash digest
SHA256 3fb83499e8bc99265e2a40f9ac4e276e7f01f0f212c37a44d2e4b1c019a8d6f8
MD5 73d2159e6d55f3ebe50c068c4e60f39d
BLAKE2b-256 594eadb4bc03586ba160f412d5b8ff47413eaba9019edae58b756ef71b96e313

See more details on using hashes here.

File details

Details for the file BaSiCPy-0.2.0.dev2-py3-none-any.whl.

File metadata

  • Download URL: BaSiCPy-0.2.0.dev2-py3-none-any.whl
  • Upload date:
  • Size: 21.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.6

File hashes

Hashes for BaSiCPy-0.2.0.dev2-py3-none-any.whl
Algorithm Hash digest
SHA256 5bbf8167d4e6762ba7e3c49fb31a4f0f50629bf7f2e296cc347f192573c08575
MD5 ec537f3da3bad12fea7a7e9941db44c0
BLAKE2b-256 214870733816dd751465e66cf9d5bc8f999e930a45b690bc4aea34589466628f

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