pyxem / orix

Analysing crystal orientations and symmetry in Python
https://orix.readthedocs.io
GNU General Public License v3.0
79 stars 46 forks source link

Compute orientation similarity map from the n best near matches per map pixel #51

Open hakonanes opened 4 years ago

hakonanes commented 4 years ago

EMsoft provides the orientation similarity metric (OSM). From their wiki:

[...] a map for which the intensity in each pixel measures how many of the top N matches that pixel has in common with its nearest neighbors. For a well annealed material, neighbouring pixels have very similar top match lists, so the OSM value will be high; near grain boundaries, one or more of the neighbors will have a completely different top match list, so the OSM value will be substantially smaller. As a result, Orientation Similarity maps generally show a clear outline of the microstructural components (grains, phases, voids, etc.).

This should be implemented as a method in the CrystalMap class, I think.

EMsoft implementation: EBSDgetOrientationSimilarityMap (https://github.com/EMsoft-org/EMsoft/blob/f5e6c8a5cb186478f5d34597708d4962f245a794/Source/EMsoftHDFLib/commonmod.f90#L335).

I think it should be implemented as two tools, the second using the first:

  1. Compare the best n matches for one map position
  2. Compare the best n in one map position to the best n matches in the four nearest neighbours, or whatever number of neighbours you want
dnjohnstone commented 4 years ago

Do you have a reference to the paper in which they described this? I only ask because I'm pretty sure I've read it but I can't find it right now...

hakonanes commented 4 years ago

Of course: Marquardt, Katharina, De Graef, Marc, Singh, Saransh, Marquardt, Hauke, Rosenthal, Anja, Koizuimi, Sanae: Quantitative electron backscatter diffraction (EBSD) data analyses using the dictionary indexing (DI) approach: Overcoming indexing difficulties on geological materials , American Mineralogist 102(9), 1843–1855, 2017. DOI: https://doi.org/10.2138/am-2017-6062

dnjohnstone commented 4 years ago

Ok right - I was running a microscope with Katharina last week... probably should have known that...

hakonanes commented 4 years ago

Wow, there you go! I'm a big fan of that paper.

dnjohnstone commented 4 years ago

I think that this remains on the roadmap with relatively high priority, but I also think there are enough other items in the 0.5.0 milestone that are higher priority, therefore assigning to v0.6.0

hakonanes commented 4 years ago

Yeah, we want this for assessing pattern comparisons in kikuchipy. But not immediately, so happy to wait.

hakonanes commented 3 years ago

The kikuchipy PR https://github.com/pyxem/kikuchipy/pull/234 contains calculation of the orientation similarity map from a 3D map with 2D navigation shape and n number of indices per navigation point, the indices pointing to triplets of Euler angles in a 1D Euler angle array.

It was decided (off GitHub yesterday) that this code would be merged into kikuchipy in the kikuchipy.indexing module for now, but should be considered ported to orix.crystal_map.CrystalMap in the future.

pc494 commented 3 years ago

To confirm, I think we will eventually want CrystalMap to do this.

dnjohnstone commented 3 years ago

To confirm, I think we will eventually want CrystalMap to do this.

Agree

hakonanes commented 3 years ago

To confirm, I think we will eventually want CrystalMap to do this.

Agree

this is implemented in kikuchipy (kikuchipy.indexing.orientation_similarity_map) by @onatlandsmyr. either i or him and i will move it to orix after we have released a v0.3 of kikuchipy in december.

hakonanes commented 3 years ago

We have computation of orientation similarity from indices into a simulation dictionary (as used by e.g. EMsoft) in kikuchipy: https://github.com/pyxem/kikuchipy/blob/master/kikuchipy/indexing/orientation_similarity_map.py. The plan is to move that functionality into a CrystalMap.add_orientation_similarity() method (or called something similar) for v0.7.