Fit ONE diffeomorphism to many matched objects (multi-object registration)
Source:R/deformetrica4.R
deformetrica_register_multi.RdThe flyconnectome/deformetricaLR recipe, ported to Deformetrica 4: register a
whole SET of matched cognate objects (e.g. left/right neuron tracts) with a
single diffeomorphism, optionally anchored by a shared landmarks point cloud.
Objects may mix meshes, neurons (polylines) and point sets; each sources[[i]]
is matched to targets[[i]] by name.
Usage
deformetrica_register_multi(
sources,
targets,
kernel_width,
object_kernel_width = kernel_width,
landmarks = NULL,
data_sigma = 0.5,
landmark_sigma = mean(data_sigma),
timepoints = 10L,
max_iterations = 150L,
device = c("auto", "cpu", "cuda"),
deformetrica = NULL,
workdir = tempfile("dfca_multi_"),
verbose = FALSE
)Arguments
- sources, targets
Named, equal-length lists of matched objects.
sourcesare templates (moving),targetsthe subject (fixed). Names become object ids.- kernel_width
Deformation kernel width.
- object_kernel_width
Data-attachment kernel width - the spatial scale at which each object's surface/curve mismatch is measured (Current/Varifold). Smaller = finer, more local matching, which pulls small structures (galls, noduli) onto their target more tightly. A single value for every object, or a per-object vector (recycled if length 1; matched by name to
sourcesif named, else in order). Defaults tokernel_width. NB there is a working window: it must be large enough that a source object and its target overlap (Current/Varifold have no gradient between non-overlapping shapes, so too-small a value leaves that object un-warped), yet small enough that many densely-packed objects are not blurred into a single current field (which also collapses the gradient). If a fit returns zero momenta (an identity warp), the affine pre-alignment left the objects too far apart for the chosenobject_kernel_width, or - with many co-located objects - it is too large.- landmarks
Optional
list(source=, target=)of anchoring point matrices, added as a shared Landmark object (theinc_tracts_lmarksregulariser). NB an anchor that the affine pre-alignment already satisfies contributes ~no gradient and can dominate the balance, yielding an identity warp; anchor only points that still need moving, or omit it and rely on the pre-alignment.- data_sigma
Data-attachment noise sigma. A single value applied to every object, or a per-object vector (recycled if length 1; matched by name to
sourcesif named, else taken in order). Smaller sigma weights that object more strongly in the fit - e.g. give homologous neuropils a small sigma and the outer hull a larger one so the neuropils drive the internal alignment.- landmark_sigma
Data-attachment sigma for the optional shared
landmarksobject (defaults to the mean ofdata_sigma).- timepoints, max_iterations, device, deformetrica, workdir, verbose
Value
A deformetricareg object; see deformetrica_register(). Apply it with
nat::xform(x, reg) or deformetrica_shoot().
See also
deformetrica_register() for the single-object case.