Numba-accelerated local 2D Otsu thresholding for 3D images.
Project description
🧠 Local 2D Otsu Thresholding
Local 2D Otsu Thresholding is a Numba-accelerated implementation of a local 2D Otsu thresholding method for 3D images.
This algorithm adapts the 2D Otsu threshold within a sliding 3D window, enabling robust segmentation in datasets with spatially varying intensity distributions.
⚙️ Installation
Install the latest stable version from PyPI:
pip install otsu2D
🚀 Example Usage
import numpy as np
from otsu2D import getBinary
# Create sample 3D image
img = np.random.randint(0, 256, size=(10, 10, 10), dtype=np.uint8)
# Get threshold map and binary image
binary = getBinary(img, window_size=(3, 3, 3), mean_window_size =(3,3,3))
🖥️ Command Line Usage
You can execute the script with custom parameters:
python runner.py --shape 10 10 10 --window 3 3 3 --mean_window 3 3 3
📦 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file otsu2d-0.1.0.tar.gz.
File metadata
- Download URL: otsu2d-0.1.0.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccc8654afa9e76e57334802dc0577529d4e9ef8b5116edc90629752b85c3b13d
|
|
| MD5 |
4a26df983ca00fcb961a9a7dfcf0708a
|
|
| BLAKE2b-256 |
0805fab5e135cb404de113c96a668cfd9fa73e427a8977d692caac84104d3ad7
|
File details
Details for the file otsu2d-0.1.0-py3-none-any.whl.
File metadata
- Download URL: otsu2d-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ec4d29c29ba38fed0c74c5de548c725f82101f90280da7e344e08efc623b6b6
|
|
| MD5 |
678236e85240d370659267d27c967158
|
|
| BLAKE2b-256 |
6cfacf52c49a069b7af663f9a30da0897a7a20c165f211a861c6adb2ef929ed6
|