This PR adds convenience methods for Hough indexing by a very thin wrapper around PyEBSDIndex. The methods are added to simplify use of kikuchipy with PyEBSDIndex.
Caveats:
Uses only a single thread via pyebsdindex.ebsd_index.EBSDIndexer.index_pats(). To get the best speed and memory handling, one should use PyEBSDIndex directly, e.g. via ebsd_index.index_pats_distributed().
Only patterns from FCC and BCC crystals can be indexed at the moment, as these are the only current phases supported by PyEBSDIndex.
A CrystalMap is returned from the new method EBSD.hough_indexing(), which removes most of the inconvenience of getting a map from the array PyEBSDIndex' returns from its EBSDIndexer.index_pats() and similar functions. A function kikuchipy.indexing.xmap_from_hough_indexing_data() requring the array and an orix PhaseList can be used to convert the array to a crystal map when using PyEBSDIndex directly (not via hough_indexing()).
EBSD.hough_indexing() requires an pyebsdindex.ebsd_index.EBSDIndexer, which can be conveniently created using a new method EBSDDetector.get_indexer(phase_list), where phase_list is a PhaseList. This ensures that all detector parameters (sample tilt, camera elevation, pattern shape) and the phase list (either FCC, BCC or both, at the moment) are handled correctly.
Lastly, a EBSD.hough_indexing_optimize_pc() method is added to optimize projection centers (PCs). This wraps pyebsdindex.pcopt.optimize() or pyebsdindex.pcopt.optimize_pso(), depending on whether Nelder-Mead or particle swarm is chosen as optimization function. A EBSDDetector with optimized PCs is returned.
All tutorial notebooks using Hough indexing have been updated. They demonstrate nicely how to use the new functionality.
PyEBSDIndex is an optional dependency. It should be installed manually or via pip install kikuchipy[all]. all is a new dependency list installing all dependencies and optional dependencies (PyEBSDIndex, NLopt, PyVista). The viz dependency list (PyVista) is deprecated and will be removed in 0.9.
@drowenhorst-nrl: Hough indexing in kikuchipy is a very thin wrapper around PyEBSDIndex. This PR contains no duplication of functionality. I hope the new functionality in kikuchipy will increase the use of PyEBSDIndex and help identify any bugs going forward.
Description of the change
This PR adds convenience methods for Hough indexing by a very thin wrapper around PyEBSDIndex. The methods are added to simplify use of kikuchipy with PyEBSDIndex.
Caveats:
pyebsdindex.ebsd_index.EBSDIndexer.index_pats()
. To get the best speed and memory handling, one should use PyEBSDIndex directly, e.g. viaebsd_index.index_pats_distributed()
.A
CrystalMap
is returned from the new methodEBSD.hough_indexing()
, which removes most of the inconvenience of getting a map from the array PyEBSDIndex' returns from itsEBSDIndexer.index_pats()
and similar functions. A functionkikuchipy.indexing.xmap_from_hough_indexing_data()
requring the array and an orixPhaseList
can be used to convert the array to a crystal map when using PyEBSDIndex directly (not viahough_indexing()
).EBSD.hough_indexing()
requires anpyebsdindex.ebsd_index.EBSDIndexer
, which can be conveniently created using a new methodEBSDDetector.get_indexer(phase_list)
, wherephase_list
is aPhaseList
. This ensures that all detector parameters (sample tilt, camera elevation, pattern shape) and the phase list (either FCC, BCC or both, at the moment) are handled correctly.Lastly, a
EBSD.hough_indexing_optimize_pc()
method is added to optimize projection centers (PCs). This wrapspyebsdindex.pcopt.optimize()
orpyebsdindex.pcopt.optimize_pso()
, depending on whether Nelder-Mead or particle swarm is chosen as optimization function. AEBSDDetector
with optimized PCs is returned.All tutorial notebooks using Hough indexing have been updated. They demonstrate nicely how to use the new functionality.
PyEBSDIndex is an optional dependency. It should be installed manually or via
pip install kikuchipy[all]
.all
is a new dependency list installing all dependencies and optional dependencies (PyEBSDIndex, NLopt, PyVista). Theviz
dependency list (PyVista) is deprecated and will be removed in 0.9.@Erlendos12, @htrellin and @olavlet: These changes might interest you for your https://github.com/htrellin/EBSD-GUI.
@drowenhorst-nrl: Hough indexing in kikuchipy is a very thin wrapper around PyEBSDIndex. This PR contains no duplication of functionality. I hope the new functionality in kikuchipy will increase the use of PyEBSDIndex and help identify any bugs going forward.
Progress of the PR
Minimal example of the bug fix or new feature
The indexing tutorials in the docs built from this PR demonstrates the new functionality nicely: https://kikuchipy--590.org.readthedocs.build/en/590/tutorials/index.html#indexing
For reviewers
__init__.py
.CHANGELOG.rst
.release.py
,.zenodo.json
and.all-contributorsrc
with the table regenerated.