if(interactive() && ants_available()) {
fi <- as_ANTsImage(ants$get_ants_data('ch2'))
mytx <- ants_motion_correction( fi )
par(mfrow = c(1, 2), mar = c(1,1,1,1))
image(fi[,,91], asp = 1, axes = FALSE)
image(mytx$motion_corrected[,,91], asp = 1, axes = FALSE)
}
Run the code above in your browser using DataLab