Coregistration and resampling to functional dimensions


This may be a very basic question, but I thought it worth asking. Currently I’m using Flirt to register my functional images to the T1 anatomical. However, the output resamples the functional data to the T1 space and I would like to end up with functional images that remain 64x64x39 (voxels are 3^3) like the originals. Am I just missing a step here? I don’t explicitly enter an iso size so I thought it would register to T1 (which does resample to 1mm), but then do the inverse and go back to 3mm space as is done with the fsl gui. Am I just missing a step?

Any guidance would be greatly appreciated!

Hi all,

The writing below is from the FSL documentation answering how to change resolutions. However, I’m not sure how to execute the “The appropriate offset to keep the COV constant is half of the difference in the respective FOVs (in mm).” What does “difference in the respective FOVs” actually mean? I tried just doing a subtraction between original XYZ and translation mat XYZ and then dividing it by two, but that did not give me the right image. Does anyone have a good example of how to do this? Its important to be able to get back to this using nipype.

Thank you!

Can I register to an image but use higher/lower resolution (voxel size)?

The registration and resampling stages in FLIRT are totally independent. In the registration stage it tries to find the transformation that best aligns the images, using a customised global optimisation technique that operates over multiple resolutions. Once the best transformation has been found the original input image is resampled, using the transformation found previously, to match the reference image. That is, the final output image will contain intensities derived from the input image but will have a Field Of View (FOV) and voxel size that matches the reference image. If a higher or lower resolution version of the final image is required it is necessary to save the transformation from the registration stage and then apply it in a separate stage where a new reference is used to specify the desired voxel size and FOV.

In the FLIRT GUI, the transformation is automatically saved in a file with an extension of .mat and this transformation can be applied to the input image (for resampling) with the GUI ApplyXFM which allows the output image voxel size and FOV to be specified either directly or by using a reference image with the appropriate size. Note that if a reference image is used it does not have to be the same image as in the registration and in fact the contents of the image (the intensities) are not used at all - only the voxel size and FOV are used.

At the command line, the transformation can be saved using the -omat option. This file can then be used for resampling by specifying it with the -init and -applyxfm options. That is, the resampling is done using flirt with the following syntax:

  • flirt -in inimage -out outimage -ref refimage -applyxfm -init savedtransform.mat

In this form the reference image is used to specify the voxel size and FOV only - all intensities within it are ignored. To create a reference image of the appropriate size, if none already exists, use fslcreatehd to make a blank image (one filled with zeros) of appropriate dimensions. Note that in previous versions fslcreatehd did not create an image, only the .hdr part of an Analyze file.

Note that when changing the FOV rather than the voxel size, the bottom left corner remains fixed. Hence, resampling to a smaller FOV will tend to cut-off the portions of the image with large x, y or z coordinates (near the right/top). In order to resample to a smaller FOV but keep say the Centre of Volume (COV) in the centre of both images it is necessary to add an extra translation to the transformation file. This can be done by adding the appropriate offsets (in mm) to the values in the right hand column (first row is x, second is y, third is z) of the transformation (.mat) file - which is in plain text. The appropriate offset to keep the COV constant is half of the difference in the respective FOVs (in mm).

Have you been able to resolve this problem?