Electron SPectro-Microscopy Python Library
Project description
The espm package is designed for simulation and physics-guided NMF decomposition of hyperspectral data. Even though the package is mainly centered around electron spectro-microscopy applications, custom models can be implemented for other type of data. Currently espm supports the simulation and analysis of simultaneous scanning transmission electron microscopy and energy dispersive X-ray spectroscopy (STEM / EDXS). In future implementation, we will try to extend the package to support electron energy loss spectroscopy (EELS).
This library is integrated as much as possible in the hyperspy <https://hyperspy.org> and scikit-learn <https://scikit-learn.org> frameworks.
The main components of the package are: - The simulation of STEM-EDXS datasets using espm.datasets which combines espm.weights for the simulation of spatial distributions and espm.models for the simulation of spectra. - The hyperspectral unmixing of STEM-EDXS spectrum images using espm.estimators. This module contains algorithms to perform non-negative matrix factorization with diverse regularisation (e.g. Laplacian or L1) and contraints (e.g. simplex). - The espm.models module can also be used to perform a physics-guided decomposition of STEM-EDXS datasets.
Installation
You can install this package from PyPi using:
$ pip install espm
If you want to develop, please use the option:
$ git clone https://github.com/adriente/espm.git $ cd espm $ pip install cython $ pip install -e .[dev]
If you get issues regarding pandoc when using make doc, you can install it using:
$ sudo apt-get install pandoc
or:
$ conda install pandoc
Recommended Installation
We recommend to install the package in a virtual environment using conda:
$ conda create -n espm python=3.11 $ conda activate espm $ pip install espm $ conda install jupyterlab
It is especially useful for the interactive plotting in the notebooks.
Getting started
Try the api.ipynb notebook in the notebooks folder.
Documentation
The documentation is available at https://espm.readthedocs.io/en/latest/
You can get started with the following notebooks:
Simulate STEM-EDXS data : https://espm.readthedocs.io/en/latest/introduction/notebooks/generate_data.ipynb
Physics-guided decomposition (ESpM-NMF) STEM-EDXS data : https://espm.readthedocs.io/en/latest/introduction/notebooks/api.html
Tests of the ESpM-NMF with a toy dataset : https://espm.readthedocs.io/en/latest/introduction/notebooks/toy-problem.html
CITING
If you use this library, please cite on of the following papers:
@article{teurtrie2023espm,
title={espm: A Python library for the simulation of STEM-EDXS datasets},
author={Teurtrie, Adrien and Perraudin, Nathana{\"e}l and Holvoet, Thomas and Chen, Hui and Alexander, Duncan TL and Obozinski, Guillaume and H{\'e}bert, C{\'e}cile},
journal={Ultramicroscopy},
pages={113719},
year={2023},
publisher={Elsevier}
}
@article{Teurtrie_2024,
doi = {10.1088/2632-2153/ad9192},
year = {2024},
month = {nov},
publisher = {IOP Publishing},
volume = {5},
number = {4},
pages = {045050},
author = {Teurtrie, Adrien and Perraudin, Nathanaël and Holvoet, Thomas and Chen, Hui and Alexander, Duncan T L and Obozinski, Guillaume and Hébert, Cécile},
title = {From STEM-EDXS data to phase separation and quantification using physics-guided NMF},
journal = {Machine Learning: Science and Technology}
}
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file espm-1.1.3.tar.gz.
File metadata
- Download URL: espm-1.1.3.tar.gz
- Upload date:
- Size: 5.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1a41e45e6bb916761b0821b195be7b79e4dc7fe3d52e546880046b5fb12b0826
|
|
| MD5 |
b4348960f94bac19dcdd205436bfc680
|
|
| BLAKE2b-256 |
fee9e19de8fa854d5cb005e1cdfb13dcb47db946efbb1e0f00dc3a11128b90da
|
File details
Details for the file espm-1.1.3-py3-none-any.whl.
File metadata
- Download URL: espm-1.1.3-py3-none-any.whl
- Upload date:
- Size: 353.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4fb78fd4e3082874bb6ebea50e5c93dac933099108922fdf27005aefef8929d2
|
|
| MD5 |
987685cc601ba25bebef2996f8734014
|
|
| BLAKE2b-256 |
d0c5d02c4508bc4828a38aaf3407b969a202b956aeadf9e3047ba3a87857ca51
|