Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Static pattern matching framework, orientation similarity map and cry…
…stal map merging (#234) * feat(SimilarityMetric): ZNCC, NDP and user defined metrics Framework for calculating similarities between 2D gray-tone images of equal size. * fix(SimilarityMetric): squeeze dimensions of similarity matrix * fix(SimiliarityMetric): rechunk dask arrays after type conversion * refactor(SimilarityMetric) length of shape -> ndim, and removed unnecessary squeeze call. * test(SimilarityMetric): Many to many ZNCC Produce value of 1 with equal pattern and template * refactor: removed metricscopes including ANY * wip: tests cover most cases * test: remove print statement * refactor: indexation -> indexing * Reformat docstrings, add Ole to credits, add indexing module to doc Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * refactor: renamed variables and made functions private * refactor: underscore prefix * refactor: underscore prefix * Update docstring table, and more Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Add indexing module to kikuchipy/__init__.py Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Add static dictionary indexing note in changelog Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * fix: change standard shape of similarity matrix Change data shape from (N,nm) to (nm,N) to correspond better with cdist in scipy and general logic. * test: update tests to new output standard * fix: _is_compatible to be working for all scopes * Clarify parameters in docstrings, some minor syntax changes, repr Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Docstring explanation of _is_compatible() Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Return numpy where only numpy arrays are passed, test repr Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Improve return numpy/dask test Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * feat(template_match): Keep n largest metric results and template indices * tests: simple tests covering all lines * refactor: move code to give user more specific error * refactor: removed comment * feat: StaticDictionaryIndexing, OSM and xmap merging Index patterns from preloaded sets of templates and produce CrystalMaps with Orientation Similarity Maps. * wip: empty test files * docs: template_match and slicing of templates * fix: accept all scopes in template_match * refactor: renamed variables and removed unnecessary code * refactor: moved code to read metric str earlier * docs: template slices and punctuation marks. * fix: raise NotImplementedError When compute=False and n_slices is not None. * fix: allow user-defined footprint in OSM * refactor+test: _merge -> merge_crystalmaps * test: StaticDictionaryIndexing and OSM * docs: StaticDictionaryIndexing * fix: OSM bug * refactor: template_match -> pattern_match And more importantly: patterns->experimental, templates->simulated * refactor(SimilarityMetric): patterns->experimental, templates->simulated * docs: data -> patterns * feat: EBSD.index method using StaticDictionaryIndexing * fix: cyclic import and some documentation * Remove setting of n_slices to None in static dictionary comp. Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * No longer raises ValueWarning instead of Error on merge equal phases * Warns instead of raising error on merge equal phases Updated commit summary. * refactor: templates -> simulated * refactor+test(EBSD): .index(...) -> .dictionary_indexing(...) * test: fix to pass * Intermediate commit before merging master into this branch Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Docstring changes, alternative merge_crystal_map [skip ci] Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Enable single scores per point, return comb. scores/indices Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Cont. testing crystal map merging, ensuring all tests pass Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * 100% coverage for xmap merging, some tests left Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Finish crystal map merge tests Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Touch up merge_crystal_maps docstring Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Changes to static dictionary indexing and OSM [skip ci] Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * MetricScope SOME_TO_MANY/ONE, 100% coverage Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Rename ZNCC->NCC, make ncc and ndp available from module Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Update changelog Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Add equation from Marquardt et al. (2017) to OSM docstring Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Print phase name and memory use % in indexing progressbar Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Clarify difference of keep_n variable in _pattern_matching funcs Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> * Dictionary indexing (DI) -> pattern matching, but keep DI references Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com> Co-authored-by: Håkon Wiik Ånes <hwaanes@gmail.com>
- Loading branch information