dictionary_indexing#

EBSD.dictionary_indexing(dictionary: EBSD, metric: Union[SimilarityMetric, str] = 'ncc', keep_n: int = 20, n_per_iteration: Optional[int] = None, signal_mask: Optional[ndarray] = None, rechunk: bool = False, dtype: Optional[Union[str, dtype, type]] = None) CrystalMap[source]#

Match each experimental pattern to a dictionary of simulated patterns of known orientations to index them [Chen et al., 2015, Jackson et al., 2019].

A CrystalMap with "scores" and "simulation_indices" as properties is returned.

Parameters:
dictionary

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 the SimilarityMetric abstract class methods. See NormalizedCrossCorrelationMetric and NormalizedDotProductMetric 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 an EBSD 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.

New in version 0.5.

signal_mask

A boolean mask equal to the experimental patterns’ detector shape (n rows, n columns), where only pixels equal to False are matched. If not given, all pixels are used.

New in version 0.5.

rechunk

Whether metric is allowed to rechunk experimental and dictionary patterns before matching. Default is False. Rechunking usually makes indexing faster, but uses more memory. If a custom metric is passed, whatever rechunk is set to will be used.

New in version 0.5.

dtype

Which data type metric shall cast the patterns to before matching. If not given, "float32" will be used unless a custom metric is passed and it has set the dtype, which will then be used instead. "float32" and "float64" are allowed for the available "ncc" and "ndp" metrics.

New in version 0.5.

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 the xmap.prop dictionary as "scores" and "simulation_indices".

Notes

Changed in version 0.5: Only one dictionary can be passed and the return_merged_crystal_map and get_orientation_similarity_map parameters were removed.