dictionary_indexing#
- EBSD.dictionary_indexing(dictionary: EBSD, metric: SimilarityMetric | str = 'ncc', keep_n: int = 20, n_per_iteration: int | None = None, navigation_mask: ndarray | None = None, signal_mask: ndarray | None = None, rechunk: bool = False, dtype: str | dtype | type | None = None) CrystalMap[source]#
Index patterns by matching each pattern to a dictionary of simulated patterns of known orientations [Chen et al., 2015, Jackson et al., 2019].
- Parameters:
- dictionary
One EBSD signal with dictionary patterns. The signal must have a 1D navigation axis, an
xmapproperty with crystal orientations set, and equal detector shape.- metric
Similarity metric, by default
"ncc"(normalized cross-correlation)."ndp"(normalized dot product) is also available. A valid user-defined similarity metric may be used instead. The metric must be a class implementing theSimilarityMetricabstract class methods. SeeNormalizedCrossCorrelationMetricandNormalizedDotProductMetricfor examples.- keep_n
Number of best matches to keep, by default 20 or the number of dictionary patterns if fewer than 20 are available.
- n_per_iteration
Number of dictionary patterns to compare to all experimental patterns in each indexing iteration. If not given, and the dictionary is a
LazyEBSDsignal, it is equal to the chunk size of the first pattern array axis, while if if is anEBSDsignal, it is set equal to the number of dictionary patterns, yielding only one iteration. This parameter can be increased to use less memory during indexing, but this will increase the computation time.- navigation_mask
A boolean mask equal to the signal’s navigation (map) shape, where only patterns equal to
Falseare indexed. This can be used bymetricinprepare_experimental(). If not given, all patterns are indexed.- signal_mask
A boolean mask equal to the experimental patterns’ detector shape, where only pixels equal to
Falseare matched. This can be used bymetricinprepare_experimental(). If not given, all pixels are used.- rechunk
Whether
metricis allowed to rechunk experimental and dictionary patterns before matching. Default isFalse. Rechunking usually makes indexing faster, but uses more memory. If a custommetricis passed, whateverrechunkis set to will be used.- dtype
Which data type
metricshall cast the patterns to before matching. If not given,"float32"will be used unless a custommetricis passed and it has set thedtype, which will then be used instead."float32"and"float64"are allowed for the available"ncc"and"ndp"metrics.
- Returns:
xmapA crystal map with
keep_nrotations per point with the sorted best matching orientations in the dictionary. The corresponding best scores and indices into the dictionary are stored in thexmap.propdictionary as"scores"and"simulation_indices".
See also
refine_orientationrefine_projection_centerrefine_orientation_projection_centerkikuchipy.indexing.SimilarityMetrickikuchipy.indexing.NormalizedCrossCorrelationMetrickikuchipy.indexing.NormalizedDotProductMetrickikuchipy.indexing.merge_crystal_mapsMerge multiple single phase crystal maps into one multi phase map.
kikuchipy.indexing.orientation_similarity_mapCalculate an orientation similarity map.