Skip to main content

til

Conda GitHub tag (latest by date)

Lint, test, build, and publish PyPI PyPI pyversions

Anaconda-Server Badge Conda

contributions welcome

lauetoolsnn/LaueNN

An autonomous feed-forward neural network (FFNN) model to predict the HKL in single/multi-grain/multi-phase Laue patterns with high efficiency and accuracy is introduced.

Laue diffraction indexation (especially Laue images comprising of diffraction signal from several polycrystals/multi phase materials) can be a very tedious and CPU intensive process. To takle this, LaueNN or LauetoolsNN was developed employing the power of neural network to speed up a part of the indexation process. In the LaueNN_presentation (https://github.com/BM32ESRF/LaueNN/tree/main/presentations/LaueNN_presentation.pdf), several steps of Laue pattern indexation with classical approach is described. We have replaced the most CPU intensive step with the Neural Networks. The step where the Laue indices hkl of each spot os now determined with the Neural networks, alongside the spot hkl index, the neural network also predicts the Material that spot belongs to. This can be useful incase of Laue images comprising of diffraction signal from multi-phases. LaueNN uses the existing modules of Lauetools to generate simulated Laue patterns. The whole workflow and the application of this tool is illustrated in this article (https://onlinelibrary.wiley.com/iucr/doi/10.1107/S1600576722004198)

For classical indexation of Laue pattern (GUI and scripts), check out the sister package: https://github.com/BM32ESRF/lauetools

Video tutorial


Requirements: (latest version of each libraries accessed on 03/04/2022)


  • PyQt5 (GUI)
  • matplotlib
  • Keras
  • tensorflow
  • numpy
  • scipy (scipy transform rotation is used)
  • h5py (required for writing neural network model files)
  • scikit-learn (required for generating trained model classification reports)
  • fabio (used for opening raw Laue tiff images)
  • networkx (to be replaced with numpy in the future)
  • scikit-image (used for hough based analysis of Laue patterns)
  • tqdm (required only for notebook scripts)
  • opencv (for LOG based peak search)
  • pandas and pytables (for writing pickle to h5)

Installation


Lauetoolsnn can be installed either via PYPI usiing the following command in terminal (this installs all dependencies automatically):

https://pypi.org/project/lauetoolsnn/

https://anaconda.org/bm32esrf/lauetoolsnn

$ pip install lauetoolsnn
$ or
$conda install -c bm32esrf lauetoolsnn -c conda-forge

For macOS user, please use the conda installation to avoid build errors or can be compiled and installed locally via the setup.py file. Download the Github repository and type the following in terminal. In this case, the dependencies has to be installed manually. The latest version of each dependency works as of (01/04/2022).

$ python setup.py install

See procedure_usage_lauetoolsnn.pdf for installation and how to write the configuration file to be used with GUI. This project is also hosted on sourceforge.net https://lauetoolsnn.sourceforge.io

Documentation


Documentation (under construction) for lauetoolsnn/lauenn is on the following webpage https://lauenn.readthedocs.io/en/latest/

Example case


Two example case studies are included in the lauetoolsnn\examples folder. Run the GUI by either launching directly from the terminal using the 'lauetoolsnn' command or by running it locally with python lauetoolsneuralnetwork.py command.

First step is to load the config.txt from the example folder, it sets all the values of the GUI to the case study. In the GUI:

  • Step1: File --> load config . Select the config file from the example directory.
  • Step1a: If config file is not available, one can set parameters in the configure parameters window directly.
  • Step2: Press the configure parameters button and press Accept button at the end (the values are loaded from the config file).
  • Step3: Press Generate Training dataset button. This will generate the training and validation dataset for neural network.
  • Step4: Press Train Neural network button. This will start the training process and once finished will save the trained model.
  • Step5: Press the Live prediction with IPF map to start the prediction on predefined experimental dataset. Example datafile is included in the examples folder.
  • Step6: Once analyzed, the results can be saved using the save results button.

In addition, all the above mentioned steps can be done without the GUI and are detailed in the lauetoolsnn\example_notebook_scripts folder. Jupyter notebook scripts are provided to run all the steps sequentially.

The indexed orientation matrix is also written in ".ctf" format, which can then be opened with channel 5 Aztec or MTEX software to do post processing related to orientations analysis. MTEX post processing script is also included in the lauetoolsnn\util_script\MTEX_plot.m

Citation


If you use this software, please cite it using the metadata available in the citation_bibtex.cff file in root.

Purushottam Raj Purohit, R. R. P., Tardif, S., Castelnau, O., Eymery, J., Guinebretiere, R., Robach, O., Ors, T. & Micha, J.-S. (2022). J. Appl. Cryst. 55, 737-750.

Known Issues


So far, there is a issue with H5py and HDF5 version in the windows installation with conda. If error with H5py version mismatch exist after conda installation, please try "pip install lauetoolsnn" on windows as this should not have this problem. The other possibility is to install the H5py with pip before or after installing lauetoolsnn with conda.

Support


Do not hesitate to contact the development team at purushot@esrf.fr or micha@esrf.fr.

Funding


This code was developed as a result of French-German project funded respectively by the ANR and DFG (HoTMiX project reference number ANR-19-CE09-0035-01): https://www.bam.de/Content/EN/Projects/HoTMiX/hotmix.html

Maintainer(s)


Metadata

Release files for lauetoolsnn 3.1.19

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lauetoolsnn 3.1.19
File Size Uploaded
lauetoolsnn-3.1.19.tar.gz 43.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for lauetoolsnn 3.1.19
File Interpreter ABI Platform
lauetoolsnn-3.1.19-py3-none-any.whl Python 3 none any Details

Total release size: 55.9 MB

Release files / lauetoolsnn-3.1.19.tar.gz

Download URL lauetoolsnn-3.1.19.tar.gz
Size 43.0 MB
Tags Source
SHA-256 checksum
How to use checksums
3f19c7c8081d6b97d2828c08425f62028c2e96afea1d12e429698a3ba9c34ce2
BLAKE2b-256 checksum
How to use checksums
48f267cd636920a1d7def4ef5626fbc3d903b046b04cba4d43e3c2ee04ec8662
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release files / lauetoolsnn-3.1.19-py3-none-any.whl

Download URL lauetoolsnn-3.1.19-py3-none-any.whl
Size 12.9 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9393940cf662cc1a671bdbce752bc72fb5c4c33b204fd77c01e09a87a7a3950e
BLAKE2b-256 checksum
How to use checksums
1f9ad3b4bed2af6ccab3d802f3baa6b83b80a60424ae5310150f39c50f88137d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.10

Release history Release notifications | RSS feed

This release

3.1.19 This release

2 release files

3.1.18

2 release files

3.1.17

2 release files

3.1.13

2 release files

3.1.12

2 release files

3.1.11

2 release files

3.1.10

2 release files

3.1.9

2 release files

3.1.8

2 release files

3.1.7

2 release files

3.1.6

2 release files

3.1.5

2 release files

3.1.4

2 release files

3.1.3

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.76

2 release files

3.0.75

2 release files

3.0.74

2 release files

3.0.73

2 release files

3.0.72

2 release files

3.0.71

2 release files

3.0.70

2 release files

3.0.69

2 release files

3.0.68

2 release files

3.0.67

2 release files

3.0.66

2 release files

3.0.65

2 release files

3.0.57

1 release file

3.0.56

1 release file

3.0.55

1 release file

3.0.54

1 release file

3.0.53

1 release file

3.0.52

2 release files

3.0.51

1 release file

3.0.50

1 release file

3.0.48

1 release file

3.0.47

1 release file

3.0.46

1 release file

3.0.45

1 release file

3.0.44

1 release file

3.0.43

1 release file

3.0.42

1 release file

3.0.41

1 release file

3.0.40

1 release file

3.0.39

1 release file

3.0.38

1 release file

3.0.37

1 release file

3.0.36

1 release file

3.0.35

1 release file

3.0.34

1 release file

3.0.33

1 release file

3.0.32

1 release file

3.0.31

1 release file

3.0.30

1 release file

3.0.29

1 release file

3.0.28

1 release file

3.0.27

1 release file

3.0.26

2 release files

3.0.25

1 release file

3.0.24

1 release file

3.0.23

1 release file

3.0.22

1 release file

3.0.21

1 release file

3.0.20

1 release file

3.0.19

1 release file

3.0.18

1 release file

3.0.17

1 release file

3.0.16

1 release file

3.0.15

2 release files

3.0.14

2 release files

3.0.13

2 release files

3.0.12

2 release files

3.0.11

2 release files

3.0.10

2 release files

3.0.9

2 release files

3.0.8

2 release files

3.0.7

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

2.0.44

2 release files

2.0.43

2 release files

2.0.42

2 release files

2.0.41

2 release files

2.0.40

2 release files

2.0.39

2 release files

2.0.38

2 release files

2.0.37

2 release files

2.0.36

2 release files

2.0.35

2 release files

2.0.34

2 release files

2.0.33

2 release files

2.0.32

2 release files

2.0.31

2 release files

2.0.29

2 release files

2.0.28

2 release files

2.0.27

2 release files

2.0.26

2 release files

2.0.23

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page