Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calculate pattern similarity between two patterns #15

Closed
4 tasks done
hakonanes opened this issue Jan 23, 2019 · 2 comments
Closed
4 tasks done

Calculate pattern similarity between two patterns #15

hakonanes opened this issue Jan 23, 2019 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@hakonanes
Copy link
Member

hakonanes commented Jan 23, 2019

Useful e.g. when deciding with which adjacent patterns to average each pattern, to avoid averaging across a grain boundary, as per the discussion in #13. A pattern difference map in itself is rich in information, and is comparable to e.g. a kernel average misorientation map or grain boundary map.

The 'pattern difference' procedure as explained by Wright et al. (https://doi.org/10.1016/j.ultramic.2014.10.002):

  1. Convert each pattern to a column vector.
  2. Subtract the average intensity of each pattern from each vector component.
  3. Normalise the column vector.
  4. Calculate difference between two patterns by calculating the dot product between the two normalised column vectors.
  5. Subtract the resulting difference value from 1 so that 0 indicates no difference and 1 represents the maximum difference.
  6. Average the resulting eight difference values for each pattern to its eight adjacent patterns to obtain final difference value

Edit

This is similar to obtaining the normalized cross-correlation (NCC) coeffienct or normalized dot product (NDP). We should have general implementations of both. Should implement them together since they are mainly used for the same puproses. Implementations should be so that they can be used in multiple applications in KikuchiPy. See #116 and #117 for example uses.

To do:

@hakonanes hakonanes self-assigned this Jan 23, 2019
@hakonanes hakonanes added enhancement New feature or request discussion Discussion labels Jan 23, 2019
@hakonanes hakonanes removed their assignment Sep 23, 2019
@hakonanes hakonanes changed the title Calculate pattern difference Calculate pattern similarity Jan 6, 2020
@hakonanes hakonanes changed the title Calculate pattern similarity Calculate pattern similarity between two patterns Jan 6, 2020
@hakonanes hakonanes removed the discussion Discussion label Jan 6, 2020
@hakonanes hakonanes added this to the v0.2.0 milestone Jan 6, 2020
@hakonanes
Copy link
Member Author

Note that normalized and zero-normalized correlation is already present in the kikuchipy.util.pattern_similarity, however it is not used by the EBSD class yet. Future similarity methods should be implemented there.

@hakonanes hakonanes modified the milestones: v0.2.0, v0.3.0 May 11, 2020
@hakonanes hakonanes modified the milestones: v0.3.0, future Sep 16, 2020
@hakonanes hakonanes modified the milestones: future, v0.3.0 Oct 22, 2020
@hakonanes
Copy link
Member Author

This is implemented in #231, #232, and #233.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant