Skip to contents

The 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. sources are templates (moving), targets the 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 sources if named, else in order). Defaults to kernel_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 chosen object_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 (the inc_tracts_lmarks regulariser). 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 sources if 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 landmarks object (defaults to the mean of data_sigma).

timepoints, max_iterations, device, deformetrica, workdir, verbose

As deformetrica_register().

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.