pyxem / kikuchipy

Toolbox for analysis of electron backscatter diffraction (EBSD) patterns
https://kikuchipy.org
GNU General Public License v3.0
79 stars 30 forks source link

Make EBSD indexing/refinement more flexible by allowing navigation masks #593

Closed hakonanes closed 1 year ago

hakonanes commented 1 year ago

Description of the change

Updates to EBSD dictionary indexing and refinement in this PR allow for a navigation mask to be passed to those methods to only index or refine the patterns/orientations/projection centers (PCs) of interest.

The masking depends on the orix crystal map's is_in_data attribute array, which keeps track of points which are in the data. Whenever a crystal map is returned, the masked out points are entered as False in this array. If a crystal map with some points not in the data is passed to the refinement methods, only the points in the data are refined.

This functionality enables hybrid indexing (as sought by @IMBalENce in https://github.com/pyxem/kikuchipy/issues/458#issuecomment-953407008), in which only bad points from Hough indexing can easily be singled out and dictionary indexed using a boolean mask. To merge the good Hough indexed points and the dictionary indexed points, both need to be refined in order to obtain smooth misorientations and get the same score so these can be compared when merging.

The function for merging single phase crystal maps also allows navigation mask(s).

A tutorial showing this workflow on a small dataset of very noisy recrystallized Ni patterns is part of this PR.

Other changes:

Navigation masks allow a route for refining multi phase maps in that one can get a single phase view of the multi phase map and refine only this, do this for all phase and subsequently merge. This workflow is basically what is sought in #411. Closes #411.

Navigation masks is the only improvement listed in #422 which I consider necessary. Closes #422.

I anticipate that these changes are the final ones before releasing version 0.8.

Progress of the PR

Minimal example of the bug fix or new feature

See hybrid indexing tutorial in this PR: https://kikuchipy--593.org.readthedocs.build/en/593/tutorials/hybrid_indexing.html.

For reviewers