R/fit-xform.R
fit_xform.Rd
Fit affine or thin plate spline transform to arbitrary transformation
Any registration compatible with nat::xform
,
including non-rigid and multi-step registrations. You must either supply
this or the refpts
argument.
A set of points in the sample (floating) space. Can be any
object compatible with nat::xyzmatrix
.
An optional set of points in the target (fixed) space matching
samplepts
. You must either supply this or the reg
argument.
A character string specifying the type of registration. See
Morpho::computeTransform
for details.
A number of points to subsample from
samplepts,refpts
. The default value of FALSE
means use all
provided points to calculate the new transform.
a 2-vector indicating the amount to scale the sample and
reference points. You can supply one vector if this is the same. If the
transform expects points in microns and returns points in microns then you
would need scale=c(1000,1)
if you want the input to be in microns
and the output to be in nm.
Additional arguments passed to Morpho::computeTransform
A homogeneous affine matrix or a nat::tpsreg
object n.b. only
in development nat (>= 1.10.1)
NB this function relies on installation of the suggested package Morpho.
if (FALSE) {
library(nat.flybrains)
reg=shortest_bridging_seq(sample='FCWB', reference="JFRC2")
fit_xform(reg, nat::kcs20, subsample=200, type='affine')
# compute transform with translations in nm not microns
fit_xform(reg, nat::kcs20, subsample=200, type='affine', scale=1000)
}