Skip to content

AFNI and NIfTI Server for NIMH/NIH/PHS/DHHS/USA/Earth

Sections
Personal tools
You are here: Home » FAQs » what is Resampling?

what is Resampling?

Document Actions
Up to table of contents

Q73. What is Resampling?
When resampling data to a new grid (e.g., going from +orig to +tlrc), it is necessary to interpolate between the data values given on the input grid to calculate values on the output grid. NN (nearest neighbor) and Li (linear) are two ways to get these output values. In 2 dimensions:
    A---------B
    |         |  A,B,C,D are values at 4 voxels in original grid
    |         |
    |         |
    |  x      |  x is value in output grid that we need to compute
    C---------D  given the values A,B,C,D and given the location of x
With NN interpolation, x = C, since C is closest to x.

With Li interpolation, x = 0.7*(0.8*C+0.2*A) + 0.3*(0.8*D+0.2*B).
The numerical factors are chosen from the fact that x is 30% of the way from left to right (so the left edge gets 70% of the weight and the right edge gets 30%), and is 20% of the way from bottom to top (so the bottom edge gets 80% of the weight and the top edge gets 20% of the weight).

If A=B=C=D, then both values of x will be the same. Otherwise, they will be different. Suppose you have a mask that is 1 inside the brain and 0 outside. In the center of the brain, all values are 1, so NN and Li resampling will give the same results; outside, all values are 0, so again NN and Li will be identical. But at the edges of the brain, there will be some x outputs that straddle some 0's and some 1's. NN will always produce x=0 or x=1 in this case (depending on what value is physically closest to the location of x). Li will produce some value between 0 and 1; NN and Li will not be identical at the brain surface. If you subtracted a NN-interpolated and Li-interpolated mask, the NN-Li mask will be 0 inside the brain and outside the brain, and there will be a thin outline of nonzero values at the brain surface.

For masks, the lesson is always use NN. This is because the input values come from a discrete set, and only NN resampling will ensure that the output values stay within that discrete set. For functional and/or anatomical values, the choice is less clear, since the input values come from a continuous set (all real numbers, say). My usual choice is to use NN for functional data and Li for anatomical data. The reason for this choice is that I feel it is a little "funny" to interpolate statistical parameters (such as a correlation coefficient).

[Answer added 23 May 2001]

This FAQ applies to: Any version.

Created by Robert Cox
Last modified 2005-08-01 14:53
 

Powered by Plone

This site conforms to the following standards: