https://github.com/mgiammar/tt2dtm
Two-Dimensional Template Matching implemented in Python
https://github.com/mgiammar/tt2dtm
cryo-em cryo-et structural-biology
Last synced: 8 months ago
JSON representation
Two-Dimensional Template Matching implemented in Python
- Host: GitHub
- URL: https://github.com/mgiammar/tt2dtm
- Owner: mgiammar
- License: bsd-3-clause
- Created: 2024-12-19T01:58:18.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2025-02-17T22:19:34.000Z (8 months ago)
- Last Synced: 2025-02-17T23:25:12.694Z (8 months ago)
- Topics: cryo-em, cryo-et, structural-biology
- Language: Python
- Homepage: https://mgiammar.github.io/tt2DTM/
- Size: 710 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tt2DTM
[](https://github.com/jdickerson95/tt2DTM/raw/main/LICENSE)
[](https://pypi.org/project/tt2DTM)
[](https://python.org)
[](https://github.com/jdickerson95/tt2DTM/actions/workflows/ci.yml)
[](https://codecov.io/gh/jdickerson95/tt2DTM)Two-dimensional template-matching implemented in Python.
## Documentation and Examples
See the `/examples` directory for a set of Jupyter notebooks demonstrating some basic usage of the package.
More extensive documentation can be found at (TODO: Add link to documentation site).## Installation
The newest released version of the package can be installed from PyPI using pip:
```bash
pip install tt2DTM
```Or you can alternatively install from source:
```bash
git clone https://github.com/jdickerson95/tt2DTM.git
cd tt2DTM
pip install .
```### For Developers
To install the package with the necessary development dependencies in an editable configuration, run:
```bash
git clone https://github.com/jdickerson95/tt2DTM.git
cd tt2DTM
pip install -e '.[dev,test]'
```## Usage
Inputs to the template matching programs are contained within Pydantic model objects which run validation on the input data. These inputs can be set in a Python script like below:
*TODO*: Add example
Alternatively, configurations can be set in a YAML file and loaded into the `MatchTemplateManager` object. See the notebook `examples/01-config_import_export.ipynb` further information on configuration fields and import/export functionality.
```python
from tt2dtm.pydantic_models import MatchTemplateManagerYAML_CONFIG_PATH = "path/to/config.yaml"
ORIENTATION_BATCH_SIZE = 8def main():
mtm = MatchTemplateManager.from_yaml(YAML_CONFIG_PATH)
mtm.run_match_template(ORIENTATION_BATCH_SIZE)# NOTE: invoking from `if __name__ == "__main__"` is necessary
# for proper multiprocessing/GPU-distribution behavior
if __name__ == "__main__":
main()
```