Skip to main content

Numba-accelerated local modified Otsu thresholding for 3D images.

Project description

🧠 Local Modified Otsu Thresholding

Local Modified Otsu Thresholding is a Numba-accelerated implementation of a local, contrast-adaptive Otsu thresholding method for 3D images.

This algorithm adapts the Otsu threshold within a sliding 3D window, enabling robust segmentation in datasets with spatially varying intensity distributions.

The method is inspired by the segmentation approach described in Subsection 2.2.2 of the article:

Segmentation-based tracking of macrophages in 2D + time microscopy movies inside a living animal

Computers in Biology and Medicine, 153 (2023), 106499

https://doi.org/10.1016/j.compbiomed.2022.106499

If you use this implementation in your research, please cite the original work that inspired this algorithm.


⚙️ Installation

Install the latest stable version from PyPI:

pip install modifiedOtsu

🚀 Example Usage

import numpy as np
from modifiedOtsu import getMask

# Create sample 3D image
img = np.random.randint(0, 256, size=(10, 10, 10), dtype=np.uint8)

# Get threshold map and binary image
threshold, binary = getMask(img, window_size=(3, 3, 3), delta=0.2)

🖥️ Command Line Usage

You can execute the script with custom parameters:

python runner.py --shape 10 10 10 --window 3 3 3 --delta 0.2

📦 Dependencies

  • NumPy
  • Numba
  • Matplotlib

Install dependencies with:

pip install numpy numba matplotlib

📜 License

This project is licensed under the MIT License. See the LICENSE file for details.

🤝 Contributing

Contributions are welcome! If you'd like to fix a bug, add a feature, or improve performance, please open a pull request or contact the maintainers.

💬 Contact

For questions, issues, or feedback, open an issue on GitHub.

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

modifiedotsu-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

modifiedotsu-0.1.0-py3-none-any.whl (8.9 kB view details)

Uploaded Python 3

File details

Details for the file modifiedotsu-0.1.0.tar.gz.

File metadata

  • Download URL: modifiedotsu-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for modifiedotsu-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e06a7668de1326a157bc49c8f1e5a05de9788fcd017d1a8559a517560cb4511
MD5 ac486c15f12f068714a319c6641cbd74
BLAKE2b-256 13cd1ae04e8a1373f5b32523108d6b683c24aa5e0d41f2b63f8080caf7918bce

See more details on using hashes here.

File details

Details for the file modifiedotsu-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: modifiedotsu-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for modifiedotsu-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b79c5b27fcd2de3e68d2479c924c5b63607145e31c2ad10404696dec338ba4e
MD5 129a17f1bde2befa08aa6406e6349011
BLAKE2b-256 468b872933bb1e7ad3f4f07b734dcc4d10ea277ef616de71632f730e23e2e5be

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