Skip to content

Part 3: Calculating Registration

Daniel Goodwin edited this page Dec 2, 2015 · 9 revisions

#Overview

This is description page for the RegisterWithDescriptors.m file. It assumes that you have successfully ran calculateDescriptorsForTile on at least two different experiments.

In the home page we identified six elements to this process. The first step is described in Part 1.

  1. It is up the user to give a best effort of cropping, zooming and rotating the various experiments by hand, then placing the data into the folder in the right format

Handled in Part 2:

  1. The images volume is partitioned into subvolumes for parallelization and robustness checking in later steps.
  2. Keypoints and feature descriptors are calculated per subvolume
*** `RegisterWithDescriptors.m` accomplishes the following
  1. Correspondence calculations per subvolume
  2. Affine transformation are calculated on random subsets of the correspondences
  3. Non-linear transform applied across the entire sample using the validated correspondences

Calculating Correspondences via SIFT

With the descriptors calculated by CalculateDescriptorsForTileAtIndices.m stored in your params.OUTPUTDIR, the first step is to calculate all corresponding points via the original SIFT method (Lowe 2004), as implemented by the VLFeat library.

Validating Correspondences via Affine Transformation

In a method closely related to RANSAC, we calculate many possible affine transforms on subvolumes of the data. These parameters are described in Part 2. The script used to calculate these ~50,000 affine transforms is calc_affine.m

test

These validated correspondences are then saved to a DATA/OUTPUTDIR/globalkeys_[samplename]round[x].mat file for quick future loading. Note that the code does not currently ask if you'd like to use previously calculated validations: if you want to recalculate, you must delete this file.

Applying a Thin Plate Spline

Once there is a set of validated correspondences, we can calculate a Thin Plate Spline ([wikipedia] (https://en.wikipedia.org/wiki/Thin_plate_spline), original paper) using the TPS3D.m script written by Yang Yang (link). Calculation of the TPS can be computationally intensive, on the order of hours, and so there is verbose output of a rough estimate of remaining time left in the calculation.

Interpolation will be necessary as the degree of warping may often mean that the output image does not have a 1-1 pixel map from the warped moving image. To these means, we have used the nearestInterp.m function written by Fitzgerald J Archibald. For reference, the image below is an artifact that arises in the output image before interpolation is applied. After interpolation there is no noticeable artifact except in the case of extreme and erroneous warping.

test

The entire Thin Plate Spline code is encapsulated in the TPS3DApply.m file, and is called at the end of the registerWithDescriptors.m file.

References:

Used the core code from TPS3D by Yang Yang

3D interpolation is done by nearestInterp.m, written by Fitzgerald J Archibald

Clone this wiki locally