if(interactive() && ants_available()) {
ants <- load_ants()
# check the python documentation here for detailed explanation
print(ants$registration)
# example to register
fi <- ants$image_read(ants$get_ants_data('r16'))
mo <- ants$image_read(ants$get_ants_data('r64'))
# resample to speed up this example
fi <- ants$resample_image(fi, list(60L,60L), TRUE, 0L)
mo <- ants$resample_image(mo, list(60L,60L), TRUE, 0L)
# SDR transform
transform <- ants_registration(
fixed=fi, moving=mo, type_of_transform = 'SyN' )
ants$plot(fi, overlay = transform$warpedmovout, overlay_alpha = 0.3)
}
Run the code above in your browser using DataLab