Density.match_structure_to_density#
- classmethod Density.match_structure_to_density(target, template, cutoff_target=0, scoring_method='NormalizedCrossCorrelation', optimization_method='basinhopping', maxiter=500)[source]#
Aligns a
tme.structure.Structure
template toDensity
target and returns an alignedtme.structure.Structure
instance.If voxel sizes of target and template dont match coordinates are scaled to the numerically smaller voxel size. Prealignment is done by center’s of mass. Finally
tme.matching_optimization.optimize_match
is used to determine translation and rotation to match a template to target.- Parameters:
- targetDensity
The target map for template matching.
- templateStructure
The template that should be aligned to the target.
- cutoff_targetfloat, optional
The cutoff value for the target map, by default 0.
- cutoff_templatefloat, optional
The cutoff value for the template map, by default 0.
- scoring_methodstr, optional
The scoring method to use for template matching. See
tme.matching_optimization.create_score_object
for available methods, by default “NormalizedCrossCorrelation”.- optimization_methodstr, optional
Optimizer that is used. See
tme.matching_optimization.optimize_match()
.- maxiterint, optional
Maximum number of iterations for the optimizer. See
tme.matching_optimization.optimize_match()
.
- Returns:
- Structure
Tuple containing template aligned to target as
tme.structure.Structure
object, translation and rotation matrix used for the transformation.
Notes
Translation and rotation are in xyz format, different from
match_densities()
, which is zyx.