Resample Image (BRAINS)


This program collects together three common image processing tasks that all involve resampling an image volume: Resampling to a new resolution and spacing, applying a transformation (using an ITK transform IO mechanisms) and Warping (using a vector image deformation field).

Use cases

Most frequently used for these scenarios:

  • Change an image’s resolution and spacing.

  • Apply a transformation to an image (using an ITK transform IO mechanisms)

  • Warping an image (using a vector image deformation field).

Interpolation types

  • NearestNeighbor: The value of the nearest voxel is copied into the new voxel

  • Linear: The average of the voxels in the input image occupying the new voxel volume is used

  • ResampleInPlace: Detailed information can be found here.

  • BSpline: Detailed information can be found here.

  • WindowedSinc: Detailed information can be found here.

Panels and their use

Inputs: Parameters for specifying the image to warp and resulting image space

  • Image To Warp (inputVolume): Image To Warp

  • Reference Image (referenceVolume): Reference image used only to define the output space. If not specified, the warping is done in the same space as the image to warp.

Outputs: Resulting deformed image parameters

  • Output Image (outputVolume): Resulting deformed image

  • Pixel Type (pixelType): Specifies the pixel type for the input/output images. If the type is “input”, then infer from the input image. The “binary” pixel type uses a modified algorithm whereby the image is read in as unsigned char, a signed distance map is created, signed distance map is resampled, and then a thresholded image of type unsigned char is written to disk.

Warping Parameters: Parameters used to define home the image is warped

  • Displacement Field (deprecated) (deformationVolume): Displacement Field to be used to warp the image (ITKv3 or earlier)

  • Transform file (warpTransform): Filename for the BRAINSFit transform (ITKv3 or earlier) or composite transform file (ITKv4)

  • Interpolation Mode (interpolationMode): Type of interpolation to be used when applying transform to moving volume. Options are Linear, ResampleInPlace, NearestNeighbor, BSpline, or WindowedSinc

  • Compute inverse transform of given transformation? (inverseTransform): True/False is to compute inverse of given transformation. Default is false

  • Default Value (defaultValue): Default voxel value

Advanced Options:

  • Add Grids (gridSpacing): Add warped grid to output image to help show the deformation that occurred with specified spacing. A spacing of 0 in a dimension indicates that grid lines should be rendered to fall exactly (i.e. do not allow displacements off that plane). This is useful for making a 2D image of grid lines from the 3D space

Multiprocessing Control:

  • Number Of Threads (numberOfThreads): Explicitly specify the maximum number of threads to use.


This tool was developed by Vincent Magnotta, Greg Harris, and Hans Johnson.


The development of this tool was supported by funding from grants NS050568 and NS40068 from the National Institute of Neurological Disorders and Stroke and grants MH31593, MH40856, from the National Institute of Mental Health.

Similar modules