Apply a transform list to map points from one domain to another
Source:R/registration.R
ants_apply_transforms_to_points.Rd
See ants$apply_transforms_to_points
for more details. Please note
point mapping goes the opposite direction of image mapping (see
ants_apply_transforms
), for both reasons of convention and
engineering.
Usage
ants_apply_transforms_to_points(
dim,
points,
transformlist,
whichtoinvert = NULL,
verbose = FALSE,
...
)
Arguments
- dim
dimensions of the transformation
- points
data frame containing columns
'x'
,'y'
,'z'
,'t'
(depending ondim
)- transformlist
list of strings (path to transforms) generated by
ants_registration
where each transform is a file name- whichtoinvert
either
NULL
,None
('Python'), or a vector of logical with same length astransformlist
; printants$apply_transforms_to_points
to see detailed descriptions- verbose
whether to verbose application of transform
- ...
ignored
Examples
if(interactive() && ants_available()) {
ants <- load_ants()
fixed <- as_ANTsImage( ants$get_ants_data('r16') )
moving <- as_ANTsImage( ants$get_ants_data('r27') )
reg <- ants_registration(
fixed = fixed, moving = moving,
type_of_transform = "antsRegistrationSyNRepro[a]")
pts <- data.frame(
x = c(128, 127),
y = c(101, 111)
)
ptsw = ants_apply_transforms_to_points(2, pts, reg$fwdtransforms)
ptsw
}