/
fit_xform.Rd
62 lines (56 loc) · 2.06 KB
/
fit_xform.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fit-xform.R
\name{fit_xform}
\alias{fit_xform}
\title{Fit affine or thin plate spline transform to arbitrary transformation}
\usage{
fit_xform(
reg,
samplepts,
refpts = NULL,
type = c("affine", "rigid", "similarity", "tps"),
subsample = FALSE,
scale = c(1, 1),
...
)
}
\arguments{
\item{reg}{Any registration compatible with \code{nat::\link{xform}},
including non-rigid and multi-step registrations. You must either supply
this or the \code{refpts} argument.}
\item{samplepts}{A set of points in the sample (floating) space. Can be any
object compatible with \code{nat::\link{xyzmatrix}}.}
\item{refpts}{An optional set of points in the target (fixed) space matching
\code{samplepts}. You must either supply this or the \code{reg} argument.}
\item{type}{A character string specifying the type of registration. See
\code{Morpho::computeTransform} for details.}
\item{subsample}{A number of points to subsample from
\code{samplepts,refpts}. The default value of \code{FALSE} means use all
provided points to calculate the new transform.}
\item{scale}{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 \code{scale=c(1000,1)} if you want the input to be in microns
and the output to be in nm.}
\item{...}{Additional arguments passed to \code{Morpho::computeTransform}}
}
\value{
A homogeneous affine matrix or a \code{nat::tpsreg} object n.b. only
in development nat (>= 1.10.1)
}
\description{
Fit affine or thin plate spline transform to arbitrary transformation
}
\details{
NB this function relies on installation of the suggested package
Morpho.
}
\examples{
\dontrun{
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)
}
}