Metadata-Version: 2.4
Name: pytme
Version: 0.3.4
Summary: Python Template Matching Engine
License-Expression: GPL-2.0-only
License-File: LICENSE
Author: Valentin Maurer
Author-email: valentin.maurer@embl-hamburg.de
Requires-Python: >=3.11,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Provides-Extra: cupy
Provides-Extra: cupy-cu12
Provides-Extra: cupy-cu13
Provides-Extra: gui
Provides-Extra: jax
Provides-Extra: jax-cu12
Provides-Extra: jax-cu13
Provides-Extra: mesh
Provides-Extra: mlx
Provides-Extra: pytorch
Requires-Dist: PyYAML (>=6.0)
Requires-Dist: cupy-cuda12x (>=13.0) ; extra == "cupy"
Requires-Dist: cupy-cuda12x (>=13.0) ; extra == "cupy-cu12"
Requires-Dist: cupy-cuda13x (>=13.6) ; extra == "cupy-cu13"
Requires-Dist: h5py
Requires-Dist: importlib-resources
Requires-Dist: jax (<0.11) ; extra == "jax"
Requires-Dist: jax[cuda12] (<0.11) ; extra == "jax-cu12"
Requires-Dist: jax[cuda13] (<0.11) ; extra == "jax-cu13"
Requires-Dist: jaxlib (<0.11) ; extra == "jax"
Requires-Dist: joblib
Requires-Dist: magicgui (>=0.8) ; extra == "gui"
Requires-Dist: matplotlib ; extra == "gui"
Requires-Dist: mlx ; (sys_platform == "darwin" and platform_machine == "arm64") and (extra == "mlx")
Requires-Dist: mrcfile (>=1.4.3)
Requires-Dist: napari[pyqt5] (>=0.5,<0.7) ; extra == "gui"
Requires-Dist: numpy (>=1.22.2)
Requires-Dist: open3d ; extra == "mesh"
Requires-Dist: pandas ; extra == "gui"
Requires-Dist: psutil
Requires-Dist: pybind11
Requires-Dist: pydantic
Requires-Dist: pyfftw (>=0.13.1)
Requires-Dist: scikit-image (>=0.21.0)
Requires-Dist: scikit-learn (>=1.2.1)
Requires-Dist: scipy (>=1.9.1)
Requires-Dist: torch ; extra == "pytorch"
Requires-Dist: torchvision ; extra == "pytorch"
Requires-Dist: voltools ; extra == "cupy"
Requires-Dist: voltools ; extra == "cupy-cu12"
Requires-Dist: voltools ; extra == "cupy-cu13"
Project-URL: Homepage, https://github.com/KosinskiLab/pyTME
Description-Content-Type: text/markdown

# Python Template Matching Engine (PyTME)

[![Build Status](https://img.shields.io/github/actions/workflow/status/KosinskiLab/pyTME/main.yml?label=CI)](https://github.com/KosinskiLab/pyTME/actions)
[![PyPI](https://img.shields.io/pypi/v/pytme.svg)](https://pypi.org/project/pytme/)

**[Documentation](https://kosinskilab.github.io/pyTME/)** | **[Installation](https://kosinskilab.github.io/pyTME/quickstart/installation.html)** | **[API](https://kosinskilab.github.io/pyTME/reference/index.html)**

PyTME is a Python library for data-intensive n-dimensional template matching using CPUs and GPUs.

With its [backend-agnostic design](https://kosinskilab.github.io/pyTME/reference/backends.html), the same code can be run on diverse hardware platforms using a best-of-breed approach. The underyling abstract backend specification allows for adding new backends to benefit from gains in performance and capabilities without modifying the library's core routines. The implementation of template matching scores is modular and provides developers with a flexible framework for rapid prototyping. Furthermore, pyTME supports a unique callback capability through [analyzers](https://kosinskilab.github.io/pyTME/reference/analyzer/base.html), which allows for injection of custom code, enabling real-time processing and manipulation of results.

PyTME includes a [graphical user interface](https://kosinskilab.github.io/pyTME/quickstart/preprocessing/gui.html) that provides simplified mask creation, interactive filter exploration, result visualization, and manual refinement capabilities. This GUI serves as an accessible entry point to the library's core functionalities, allowing users to efficiently interact with and analyze their data.

Finally, pyTME offers specialized tools for cryogenic electron microscopy data, such as wedge masks, CTF correction, as well as [means for handling structural data](https://kosinskilab.github.io/pyTME/reference/data_structures/density.html).

Running into bugs or missing a feature? Help us improve the project by opening an [issue](https://github.com/KosinskiLab/pyTME/issues).

## Installation

We recommend installation using one of the following methods

| Method   | Command                                                 |
|----------|---------------------------------------------------------|
| PyPi     | `pip install pytme`                                     |
| Source   | `pip install git+https://github.com/KosinskiLab/pyTME`  |
| Docker   | `docker build -t pytme -f docker/Dockerfile_GPU .`      |

You can find alternative installation methods in the [documentation](https://kosinskilab.github.io/pyTME/quickstart/installation.html).


## User Guide

Learn how to get started with

- [Installation](https://kosinskilab.github.io/pyTME/quickstart/installation.html)
- [Template matching](https://kosinskilab.github.io/pyTME/quickstart/matching/particle_picking.html) Find your template of interest.
- [Postprocessing](https://kosinskilab.github.io/pyTME/quickstart/postprocessing/motivation.html) Analyze template matching results and downstream integrations.

## How to Cite

If you used PyTME in your research, please cite the corresponding [publication](https://www.sciencedirect.com/science/article/pii/S2352711024000074).

```bibtex
@article{Maurer:2024aa,
    author = {Maurer, Valentin J. and Siggel, Marc and Kosinski, Jan},
    journal = {SoftwareX},
    pages = {101636},
    title = {PyTME (Python Template Matching Engine): A fast, flexible, and multi-purpose template matching library for cryogenic electron microscopy data},
    volume = {25},
    year = {2024}
}
```

