createWarpedGrid.Rd
Deforming a grid is a helpful way to visualize a deformation field. This function enables a user to define the grid parameters and apply a deformable map to that grid.
createWarpedGrid(
img,
gridStep = 10,
gridWidth = 2,
gridDirections = c(TRUE, TRUE),
fixedReferenceImage = NULL,
transform = NA,
foreground = 1,
background = 0
)
input image
width of grid blocks
width of grid lines
directions in which to draw grid lines, boolean vector
reference image space
vector of transforms
intensity value for grid blocks
intensity value for grid lines
image is output
fi <- antsImageRead(getANTsRData("r16"))
mi <- antsImageRead(getANTsRData("r64"))
mygr <- createWarpedGrid(mi)
if (FALSE) { # \dontrun{
mytx <- antsRegistration(fixed = fi, moving = mi, typeofTransform = c("SyN"))
mywarpedgrid <- createWarpedGrid(mi,
gridDirections = c(F, T),
transform = mytx$fwdtransforms, fixedReferenceImage = fi
)
plot(fi, mywarpedgrid, alpha = 0.75, color.overlay = "blue")
} # }