Skip to main content

TEMMETA is a library for transmission electron microscopy (TEM) (meta)data manipulation

Project description

# TEMMETA

TEMMETA is a library for transmission electron microscopy (TEM) (meta)data manipulation. The aim is to offer a one stop place for very basic to intermediate level operations on (S)TEM data, and be a kind of python version of ImageJ + Digital Micrograph + Velox.

Author: Niels Cautaerts, [nielscautaerts@hotmail.com](mailto:nielscautaerts@hotmail.com)

Last updated: 18/04/2020

Try it now: [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/din14970/TEMMETA/master?filepath=examples%2FTEMMETA%20demonstration.ipynb)

## What can TEMMETA do?

  • For images:
    • plotting, rebinning, linear scaling, cropping, filtering…

    • Perform Fourrier filtering by calculating fast-fourrier- transforms (FFTs), contruct FFT masks and calculating inverse fourrier transforms (IFFT)

    • Geometric phase analysis (GPA) [(Hytch et al., 1998)](http://doi.org/10.1016/S0304-3991(98)00035-7) on HRTEM images

    • Finding atomic column peak positions in HR-STEM images and fitting Gaussians to them

    • Calculating and plotting intensity line profiles along arbitrary directions in images

    • Export to png, tiff, hyperspy dataset

  • For image stacks:
    • Interactively browsing through the frames with sliders

    • Rebinning, linear scaling, cropping, filtering, of all the frames

    • Selecting and excluding frames in an image stack

    • Aligning frames in an image stack with cross-correlation

    • Averaging all the frames to create one image

    • Export frames to png’s or full dataset to hyperspy

  • For spectral data:
    • select/exclude and align frames in SpectrumStream

    • Interactively browse through spectral map with sliders

    • Create images of spectrum maps at specific energies

    • Crop and rebin spectral maps

    • Condense areas to single spectra

    • Create line profiles along arbitrary directions in spectrum maps

    • Find peaks in spectra

    • Export to hyperspy

  • For all datasets:
    • Support for automated scalebars, keeping track of axis scales, units and offsets

    • Keeping all processing history inside the metadata

Currently only Velox .emd files can be read in natively. One can still use the library for data coming from other files, but other tools will be needed to import those files and convert to the TEMMETA objects.

## How do I use TEMMETA?

### Prerequisites

### Set-up steps

  1. Create a new virtual environment on your system to install TEMMETA in

    ` $ conda create --name temmeta `

  2. Activate the virtual environment anywhere in your system with

    ` $ conda activate temmeta `

  3. Pip install temmeta

    ` $ pip install temmeta `

### Usage

  1. With the environment activated, start Jupyter Notebook with

    ` $ jupyter notebook `

  2. Import TEMMETA modules like

    ` from temmeta import data_io as dio from temmeta import image_filters as imf `

For help on how to use TEMMETA, follow the example jupyter notebook file examples/TEMMETA demonstration.ipynb. For most commands I tried to add a sufficiently descriptive docstring which you can access with help(<command name>).

## History TEMMETA started as a simple tool to read and convert Velox EMD data. As I became more familiar with the analysis needs of other people and I started seeing the limitations of other tools, it became clear TEMMETA needed to become more useful and easy for other people to use, especially those with limited python experience. Therefore I completely rewrote the library and modeled the tools after those available in popular software such as Digital Micrograph and ImageJ. TEMMETA still does not have a user interface, but the functions and classes should be familiar and easy enough for people that they can start analyzing their data in no time inside a Jupyter Notebook.

## TODOs ### Functionality * support for other file types: dm3/dm4 (Gatan), SER/EMI (FEI), TVIPS, TIFF, .blo * lazy operations on the emd dataset for exporting image frames without loading entire dataset into memory. * implement strain mapping using atomic peaks * find peaks in FFT’s and diffraction patterns * support 4D-STEM and PED datasets * exporting and importing datasets to a single file * reevaluate metadata structure * applying shifts to spectrum stream frames is currently impossibly slow. * deeper analysis of EELS/EDX data, implement a periodic table for some basic quantification and element detection. * implement more filters

### Ease of use * compile documentation with Sphinx

### Structure and format * significant refactoring is necessary. Currently most functionality is in the basictools/data_io module - this file is a monster. There is a lot of repeated code which can be factored out with multiple inheritance. * documentation must be updated and refined in most places * unit tests must be created for most modules and methods

## How can I contribute?

You may always contribute to the documentation and writing unit tests. I like [pytest](https://docs.pytest.org/en/latest/) but don’t have much experience with it myself yet. UI tools to interface with the methods would also be appreciated. If you know a faster way to make a method run, definitely contribute.

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

temmeta-0.0.2.tar.gz (64.1 kB view details)

Uploaded Source

Built Distribution

temmeta-0.0.2-py3-none-any.whl (142.7 kB view details)

Uploaded Python 3

File details

Details for the file temmeta-0.0.2.tar.gz.

File metadata

  • Download URL: temmeta-0.0.2.tar.gz
  • Upload date:
  • Size: 64.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.4

File hashes

Hashes for temmeta-0.0.2.tar.gz
Algorithm Hash digest
SHA256 32b0de33545f0703cdb2b20fb4ae102f0189836688ce246307755be14fb09f46
MD5 1a201411eb829dad05e0eef2f255249b
BLAKE2b-256 716c7893a0bb564ff88a4cc317c83bd69c56f4fc25e9f154212dcfcd607ad214

See more details on using hashes here.

File details

Details for the file temmeta-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: temmeta-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 142.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.40.0 CPython/3.7.4

File hashes

Hashes for temmeta-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 03e06910b947d350f40e9fb7b8aaece3c2bea3991e620b4b47a29842c344a557
MD5 6cd0cdfada7a565a40000d001471793f
BLAKE2b-256 9ef0279eed4e969fa025d29f8d8ec8097e64e3f68d95d66d43403a89de8b9312

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page