Metadata-Version: 2.1
Name: pytme
Version: 0.2.2
Summary: Python Template Matching Engine
Author: Valentin Maurer
Author-email: Valentin Maurer <valentin.maurer@embl-hamburg.de>
License: Proprietary
Project-URL: Homepage, https://github.com/KosinskiLab/pyTME
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Requires-Python: >=3.11
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: mrcfile>=1.4.3
Requires-Dist: numpy>=1.22.2
Requires-Dist: pyfftw>=0.13.1
Requires-Dist: pytest>=6.2.5
Requires-Dist: PyYAML>=6.0
Requires-Dist: scikit-image>=0.19.0
Requires-Dist: scikit_learn>=1.2.1
Requires-Dist: scipy>=1.9.1
Requires-Dist: pybind11
Requires-Dist: psutil
Requires-Dist: tifffile
Requires-Dist: h5py
Provides-Extra: cupy
Requires-Dist: cupy; extra == "cupy"
Requires-Dist: voltools==0.6.0; extra == "cupy"
Provides-Extra: pytorch
Requires-Dist: torch; extra == "pytorch"
Provides-Extra: jax
Requires-Dist: jax; extra == "jax"
Requires-Dist: jaxlib; extra == "jax"
Provides-Extra: all
Requires-Dist: cupy; extra == "all"
Requires-Dist: voltools==0.6.0; extra == "all"
Requires-Dist: torch; extra == "all"
Requires-Dist: jax; extra == "all"
Requires-Dist: jaxlib; extra == "all"

# 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.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.html#practical-example) 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_structure.html). Through dedicated [integrations](https://kosinskilab.github.io/pyTME/quickstart/integrations.html), the output of pyTME seamlessly integrates with commonly used cryogenic electron microscopy software such as RELION, Dynamo and IMOD.

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).


## Quickstart

Learn how to get started with

- [Preprocessing:](https://kosinskilab.github.io/pyTME/quickstart/preprocessing.html) Picking the right mask and filter for template matching.
- [Template matching:](https://kosinskilab.github.io/pyTME/quickstart/match_template.html) Find your template of interest.
- [Postprocessing](https://kosinskilab.github.io/pyTME/quickstart/postprocessing.html) Analyze template matching results and downstream integrations.

## How to Cite

If PyTME contributed significantly to your research, please cite the corresponding publication on [SoftwareX](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}}
```
