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
}
Run the code above in your browser using DataLab