The wb_command -volume-affine-resample program gets the resampling done at the command prompt with a single long command:
wb_command -volume-affine-resample d:/temp/inImage.nii.gz d:/temp/affine.txt d:/temp/matchImage.nii CUBIC d:/temp/outImage.nii
If the wb_command program isn't on the path, run this at the command prompt, from wherever wb_command.exe (or the equivalent for your platform) is installed. A lot of things need to be specified:
- inImage.nii.gz is the image you want to resample (for example, the 1x1x1 mm anatomical image)
- affine.txt is a text file with the transformation to apply (see below)
- matchImage.nii is the image with the dimensions you want the output image to have - what inImage should be transformed to match (for example, the 3x3x3 mm functional image)
- CUBIC is how to do the resampling; other options are TRILINEAR and ENCLOSING_VOXEL
- outImage.nii is the new image that will be written: inImage resampled to match matchImage; specifying a outImage.nii.gz will cause a gzipped NIfTI to be written.
You need to specify an affine transform, but I don't want to warp anything so the matrix is all 1s and 0s; just put this matrix into a plain text file (I called it affine.txt):
1 0 0 0 0 1 0 0 0 0 1 0
UPDATE 20 May 2015: Changed the resampling method to CUBIC and added a note that the program can output compressed images, as suggested by Tim Coalson.