Modality Independent Neighbourhood Descriptor (MIND)
MIND (Modality Independent Neighbourhood Descriptor) is an image registration algorithm that aims to extract structural content in the local region around each pixel/voxel which can also be seen in other modalities. The academic paper that introduces MIND can be found here (cached local copy). It supports non-rigid image registration and is generally more robust to different modalities (e.g. MRI and ultrasound images) than other registration algorithms such as MI (mutual information).
How It Works
The concept is based on the idea that each pixel in an image can be assigned a MIND descriptor, which is a vector of real numbers which describes the local structure surrounding that pixel.
Each value in the MIND descriptor for a pixel is described by the following equation1:
where:
- is the 2D greyscale image, as a 2D matrix of real values
- is the pixel location you are currently calculating the MIND descriptor for (e.g. would be the pixel at the 3rd column and 6th row)
- is an element from the search space (e.g. )
- is the set of all pixels (defined by relative shifts from ) involved in the search space, e.g. for a 4-neighbourhood search space in a 2D image,
- is a normalizing constant
- is the patch distance between the descriptor pixel and search space pixel (more on this later)
- is an estimate on the variance for the descriptor pixel (more on this later)
Note that I have changed the syntax slightly from that listed in the publication as to fit the mathematical style guide for this blog.
Given two images that need registering, you can calculate MIND descriptors for each pixel in both images. Then a simple and easily optimizable sum-of-squared differences is calculated between the MIND descriptors in each image. By transforming the compare image relative to the reference image, this value will vary. When this value is minimized, this represents the transformation which best registers the compare image ontop of the reference image. This forms the objective function for which you wish to minimize, and can be easily solved with traditional optimization algorithms such as Nelder-Mead or gradient descent.
The number of elements in this vector depends on the choice of search space . The search space involves a number of pixels in the area around the pixel that you are calculating the descriptor for. One of the most basic search spaces for a 2D image would be the four-neighbourhood, involving the pixel above, below, to the left and to the right of the pixel. For every pixel in the search space, a square patch (for example, a 3x3 patch) of pixels is found. This is compared to the similar-sized square patch centered on the pixel you are calculating the MIND descriptor for. For each pair of patches, the sum of squared differences is calculated. This value is assigned to the pixel in the search space.
An example image registration algorithm written in Matlab and using MIND/Gauss-Newton optimization can be found at: http://www.ibme.ox.ac.uk/research/biomedia/julia-schnabel/Software.
Pre-Normalizing Images
Should you normalize images (e.g. between 0 and 1) before calculating the MIND descriptors for each pixel?
If using the MIND descriptor to co-register two images, you should find that normalization should not have a significant effect on the objective function.
Worked Example
We will demonstrate how MIND works with a very basic 2D 5x5 (25 pixel) greyscale image. For simplicity, the pixels intensities have been assigned the values 1 to 25 as shown in the below diagram (typically they will range from 0 to 255 or similar bit number).
Pixel is in the upper left corner. Pixels are indexed in order (which could also be thought of as ). This matches the row-major indexing of Numpy and the C programming language.
We will work through the process of calculating the MIND descriptor for pixel , which has an intensity of 8 and is shown in dark blue in the below image. We will using the following MIND parameters:
- A search space of 4-neighbourhood (i.e. the pixels directly touching the pixel of interest), shown in light blue. The pixel we are calculating the MIND descriptor for is not in the search space.
- A patch size of 3 (more on this later).
For our search space 4-neighbourhood, we use the following pixels (coordinates are relative to the pixel we are calculating the MIND descriptor for).
Remember, these correspond to or .
For each one of the pixels in the search space , a 3x3 pixel patch is formed, with the pixel in the center (and this time, the pixel IS included in the patch). We chose a patch with a width/height of 3 for simplicity, but this is a parameter which can be adjusted. In the below image on the left, the patch for the pixel is shown. A patch centered on the MIND descriptor pixel is also formed.
With these two patches, a patch distance is calculated. Each patch element can has a different weighting (common weightings are a 2D gaussian or a constant value). This is an element-wise sum-of-squared differences calculation.
For simplicity, we will use a constant patch weighting of to normalize the 3x3 patch. For the above patches, this would be:
This value of is attached to the pixel in the search space. The same patch distance calculation is repeated for all pixels in the search space, which would give the results as shown in the below diagram:
Next, we have to calculate a variance for each pixel. For every pixel, we estimate the variance using the mean of the patch distance values calculated for each pixel in the search space.
For our chosen pixel, this would be:
If we do this for every pixel, this results in the following array (you can see the value we just calculated at entry ):
We have now ready to perform the final calculation and find the MIND descriptors for each pixel, using the equation from 1.
Because we have four pixels in the search space for each pixel we are calculating the MIND descriptor for, the MIND descriptor will also contain four values (dimensions).
For our pixel , these four values will be:
Giving the MIND descriptor:
This calculation is performed for all pixels, giving the following array of MIND descriptors (first axis is pixel columns, second axis is pixel rows, third axis contains the four values that make up the MIND descriptor for that pixel):
Optimizations
Convert the patch distance calculation into a correlation problem.
The patch distance calculation involves computing a sum-of-squared differences. You can calculate the squared differences normally, but convert the summation into a correlation problem, and then compute the result of the correlation by converting the image into the frequency domain (via the FFT or Fast Fourier Transform), multiplying, and then performing an inverse FFT.
Resources
Publications
-
Self Similarity Image Registration Based on Reorientation of the Hessian (cached local copy) claims to be an efficiency improvement on the original MIND algorithm when dealing with deformation between the two images.
-
Multimodal Fusion for Image-Guided Interventions using Self-Similarities is a newer publication involving the same author as the original MIND publication (Mattias P. Heinrich) which claims to improve in the MIND algorithm by using patch distances between pixels surrounding the pixel of interest, but not including it, thereby reducing the algorithms sensitivity to noise in the pixel of interest.
Software
-
MATLAB implementations of the MIND and SSC algorithms can be found at mpheinrich.de/software.html.
-
The GitHub repo cmirfin/BBR contains MATLAB code of the MIND algorithm and a supporting Gauss-Newton optimizer to perform two-stage non-rigid registration of MR images.
-
IBME - Julia Schnabel - Software contains MATLAB for the MIND algorithm as well as MIND/Gauss-Newton 2D registration code (again, in MATLAB).