Package: temmeta
TEMMETATEMMETA 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.comLast updated: 18/04/2020Try it now:What can TEMMETA do?Forimages: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)on HRTEM imagesFinding atomic column peak positions in HR-STEM images and 		fitting Gaussians to themCalculating and plotting intensity line profiles along 		arbitrary directions in imagesExport to png, tiff, hyperspy datasetForimage stacks:Interactively browsing through the frames with slidersRebinning, linear scaling, cropping, filtering, of all the 		framesSelecting and excluding frames in an image stackAligning frames in an image stack with cross-correlationAveraging all the frames to create one imageExport frames to png's or full dataset to hyperspyForspectral data:select/exclude and align frames in SpectrumStreamInteractively browse through spectral map with slidersCreate images of spectrum maps at specific energiesCrop and rebin spectral mapsCondense areas to single spectraCreate line profiles along arbitrary directions in spectrum mapsFind peaks in spectraExport to hyperspyForall datasets:Support for automated scalebars, keeping track of axis scales, 		units and offsetsKeeping all processing history inside the metadataCurrentlyonly Velox .emdfiles 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?PrerequisitesYou haveAnacondainstalled.Set-up stepsCreate a new virtual environment on your system to install TEMMETA in$ conda create --name temmetaActivate the virtual environment anywhere in your system with$ conda activate temmetaPip install temmeta$ pip install temmetaUsageWith the environment activated, start Jupyter Notebook with$ jupyter notebookImportTEMMETAmodules likefrom temmeta import data_io as dio
from temmeta import image_filters as imfFor help on how to useTEMMETA, follow the example jupyter notebook fileexamples/TEMMETA demonstration.ipynb. For most commands I tried to add a sufficiently descriptive docstring which you can access withhelp(<command name>).HistoryTEMMETA 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.TODOsFunctionalitysupport for other file types: dm3/dm4 (Gatan), SER/EMI (FEI), TVIPS, TIFF, .blolazy operations on the emd dataset for exporting image frames without loading entire dataset into memory.implement strain mapping using atomic peaksfind peaks in FFT's and diffraction patternssupport 4D-STEM and PED datasetsexporting and importing datasets to a single filereevaluate metadata structureapplying 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 filtersEase of usecompile documentation with SphinxStructure and formatsignificant 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 placesunit tests must be created for most modules and methodsHow can I contribute?You may always contribute to the documentation and writing unit tests. I likepytestbut 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.