From Slicer Wiki
Jump to: navigation, search
Home < Documentation < 4.0 < Modules < ResampleScalarVectorDWIVolume

For the latest Slicer documentation, visit the 4.10 page.

Introduction and Acknowledgements

This work is part of the National Alliance for Medical Image Computing (NA-MIC), funded by the National Institutes of Health through the NIH Roadmap for Medical Research, Grant U54 EB005149. Information on NA-MIC can be obtained from the NA-MIC website.
Author: Francois Budin, NIRAL
Contributor1: Sylvain Bouix, PNL
Contact: Ryan Eckbo, <email> </email>


Module Description

This module implements image and vector-image resampling through the use of itk Transforms.It can also handle diffusion weighted MRI image resampling. "Resampling" is performed in space coordinates, not pixel/grid coordinates. It is quite important to ensure that image spacing is properly set on the images involved. The interpolator is required since the mapping from one space to the other will often require evaluation of the intensity of the image at non-grid positions.

Warning: To resample DWMR Images, use nrrd input and output files.

Warning: Do not use to resample Diffusion Tensor Images, tensors would not be reoriented

Module with panels expanded
Original Image [1]
Transformed Image

Use Cases

Most frequently used for these scenarios:

  • This module is especially appropriate when one needs to resample an image and already knows the transform to apply to it. Its principal advantages resides in the fact that one can apply any kind of transform supported by ITK (rigid, affine and non-rigid) and can choose between the most commonly used interpolators. It is also able to resample scalar, vector and DWI under certain conditions) images
  • It also allows changing the spacing, the orientation, the size and the origin of the image. In that case, the image will be modified in consequences.
  • It can be used to convert the input image from one format to another (ie: image.nrrd to image.nii.gz)

Panels and their use


  • Input/Output
    • Input Volume: Input Volume to be resampled
    • Output Volume: Resampled Volume
    • Reference Volume (To Set Output Parameters): Reference Volume (spacing,size,orientation,origin)
  • Transform Parameters
    • Transform Node:
    • Deformation Field Volume: File containing the deformation field (3D vector image containing vectors with 3 components)
    • Displacement or H-Field: Set if the deformation field is an h-Field
  • Interpolation Type
    • Interpolation: Sampling algorithm (linear or nn (nearest neighborhoor), ws (WindowedSinc), bs (BSpline) )
  • Advanced Transform Parameters
    • Transforms Order: Select in what order the transforms are read
    • Not a Bulk Transform: The transform following the BSpline transform is not set as a bulk transform for the BSpline transform
    • Space Orientation inconsistency (between transform and image): Space Orientation between transform and image is different (RAS/LPS) (warning: if the transform is a Transform Node in Slicer3, do not select)
  • Rigid/Affine Parameters
    • Rotation Point: Rotation Point in case of rotation around a point (otherwise useless)
    • Centered Transform: Set the center of the transformation to the center of the input image
    • Image Center: Image to use to center the transform (used only if "Centered Transform" is selected)
    • Inverse ITK Transformation: Inverse the transformation before applying it from output image to input image
  • Manual Output Parameters
    • Spacing: Spacing along each dimension (0 means use input spacing)
    • Size: Size along each dimension (0 means use input size)
    • Origin: Origin of the output Image
    • Direction Matrix: 9 parameters of the direction matrix by rows (ijk to LPS if LPS transform, ijk to RAS if RAS transform)
  • Advanced Resampling Parameters
    • Number Of Thread: Number of thread used to compute the output image
    • Default Pixel Value: Default pixel value for samples falling outside of the input region
  • Windowed Sinc Interpolate Function Parameters
    • Window Function: Window Function \nh = Hamming \nc = Cosine \nw = Welch \nl = Lanczos \nb = Blackman
  • BSpline Interpolate Function Parameters
    • Spline Order: Spline Order
  • Manual Transform (Only used if no transform node set)
    • Transform Matrix: 12 parameters of the transform matrix by rows ( --last 3 being translation-- )
    • Transform: Transform algorithm\nrt = Rigid Transform\na = Affine Transform

Similar Modules

  • Resample DTI Volume is the equivalent module for Diffusion Tensor Images

More Information

  • The transform can be passed as an ITK Transform file using the command line, or directly as a transform node in Slicer. In the latter case, the transform can only be rigid or affine.
  • Be careful when applying multiple transforms contained in one file. Pay attention to the order of the transforms in the file and if those transforms are applied serially or simultaneously (bulk).
  • Warning : When using this module in Microsoft Windows, the flag -c which centers the transform might cause problems. Please use the long flag --centered_transform instead in that case.
  • The Transform can be given through an ITK Transform file. An example is given below.
#Insight Transform File V1.0
# Transform 0
Transform: AffineTransform_double_3_3
Parameters: 1.73205080756880 0.5 0 -0.5 .8660254037844 0 0 0 1.5 15 32 27
FixedParameters: 40 35 20

  • Be Careful : The transform file must have an empty line after the fixed parameters
  • The Fixed Parameters are the coordinates of the center of rotation
  • The Parameters are written in the following format:
    • The first 9 numbers represent a linear transformation matrix in column-major order (where the column index varies the fastest)
    • The last 3 are a translation.
  • A transform file may contain multiple transforms. The transforms are all merged together before being applied to the image. Therefore the interpolation operation is performed only once per voxel which improves the quality of the output image compared to applying each transform separatly.

Information for Developers