Learn R Programming

ANTsR (version 0.4.0)

createWarpedGrid: Create a warped grid for visualization.

Description

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.

Usage

createWarpedGrid(img, gridStep = 10, gridWidth = 2,
  gridDirections = c(TRUE, TRUE), fixedReferenceImage = NA,
  transform = NA, foreground = 1, background = 0)

Arguments

img

input image

gridStep

width of grid blocks

gridWidth

width of grid lines

gridDirections

directions in which to draw grid lines, boolean vector

fixedReferenceImage

reference image space

transform

vector of transforms

foreground

intensity value for grid blocks

background

intensity value for grid lines

Value

image is output

Examples

Run this code
# NOT RUN {
fi = antsImageRead( getANTsRData( 'r16' ) )
mi = antsImageRead( getANTsRData( 'r64' ) )
mygr = createWarpedGrid( mi )
# }
# NOT RUN {
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' )
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab