**Dan's comments in RED.**

In this article we'll examine one of the fundamental image processing tasks in neuroimaging: mutually aligning two image files. Or more than two files?

We'll use the ANTs suite of tools since it's comprehensive, fairly easy (if not extremely user-friendly) to use, and performs well. We'll also give pointers to relevant MINC concepts and programs.

...

## Background

### Images

What is an image? Okay so we're starting with philosophy. Got it. More than~~ simply~~ a 3d grid of voxels, a medical image should be thought of as continuously varying over its *domain* of definition. Thus, an **image** I is a domain D (typically some region of three-dimensional space R^{3}) together with a function f mapping values in D to the real numbers R (of course, vector or tensor-valued images are also possible). In short, an image is an ordered list of values (callled a tuple in mathematics). The tuple is defined as (D, f : D → R).

Of course, we We need to acquire, store, and manipulate images, which is typically achieved through the use of an array of voxels (and the use of arithmetic functions hidden in the computer arithmetic rather than arbitrary real a list of real numbers). We consider the voxel values to record the value of the image at the exact centre of each voxel (at least in the ITK/ANTs convention). To compute the value of an image at some point not at a voxel centre, some numerical **interpolation** between amongst the surrounding voxel values must be used. ~~(The interpolation is often considered a property of a resampling procedure - see below - but is really a property of the image itself.) ~~ For instance, in **trilinear interpolation** one finds the surrounding eight voxel centres and takes a distance-weighted average of their intensities. In **nearest neighbour interpolation**, the values are assumed to be discrete ~~- most often a semantic ~~ and the nearest voxel values are used for a majority vote for the value of the point. Nearest neighbour interpolation is used to map a segmentation atlas to an anatomical image, for example. Interpolating using splines or other families is also possible. By using interpolation at each point on a new grid, we can thus **segmentation** of some other anatomical image -**resample** an image to that grid, say to produce an image with a different spatial resolution or to bring the voxel coordinates into agreement with those of a second image for statistical purposes.

...

Given our above definition of image an image, the problem of aligning two images can then be formulated as the problem of finding a suitable mapping between these domainsthe~~se~~ domains of the two images. (We won't define 'suitable' exactly here; suffice it to say that the problem is only well-posed after making certain choices such as the cost, or loss, function; see e.g. the Elastix manual.) We have in mind that one image is warped to the 'geometry' or 'space' of the other; we call this warped image the **moving image** and the image it is warped to the **fixed image**. The result of registering two images F and M on domains D_{F} and D_{M} should be some **transformation** (or **transform**) T_{F,M}, and there should be some function *apply* which "applies T_{F,M} to F". The reader only interested in applications can in principle stop here and skip to the next section, leaving the details abstract, but it would be somewhat dangerous to do so since the underlying mathematics is so simple and the intuition so useful.

...