dictionary_indexing#
- EBSD.dictionary_indexing(dictionary: EBSD, metric: Union[SimilarityMetric, str] = 'ncc', keep_n: int = 20, n_per_iteration: Optional[int] = None, navigation_mask: Optional[ndarray] = None, signal_mask: Optional[ndarray] = None, rechunk: bool = False, dtype: Optional[Union[str, dtype, type]] = 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
xmap
property 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 theSimilarityMetric
abstract class methods. SeeNormalizedCrossCorrelationMetric
andNormalizedDotProductMetric
for 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
LazyEBSD
signal, it is equal to the chunk size of the first pattern array axis, while if if is anEBSD
signal, 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
False
are indexed. This can be used bymetric
inprepare_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
False
are matched. This can be used bymetric
inprepare_experimental()
. If not given, all pixels are used.- rechunk
Whether
metric
is allowed to rechunk experimental and dictionary patterns before matching. Default isFalse
. Rechunking usually makes indexing faster, but uses more memory. If a custommetric
is passed, whateverrechunk
is set to will be used.- dtype
Which data type
metric
shall cast the patterns to before matching. If not given,"float32"
will be used unless a custommetric
is 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:
xmap
A crystal map with
keep_n
rotations per point with the sorted best matching orientations in the dictionary. The corresponding best scores and indices into the dictionary are stored in thexmap.prop
dictionary as"scores"
and"simulation_indices"
.
See also
refine_orientation
refine_projection_center
refine_orientation_projection_center
kikuchipy.indexing.SimilarityMetric
kikuchipy.indexing.NormalizedCrossCorrelationMetric
kikuchipy.indexing.NormalizedDotProductMetric
kikuchipy.indexing.merge_crystal_maps
Merge multiple single phase crystal maps into one multi phase map.
kikuchipy.indexing.orientation_similarity_map
Calculate an orientation similarity map.