# Presentation: 490238

## Warping notes

- DDMA

## Warping

- A warp is a transform.
- The warp operator (w) defines a redistribution of intensity either by direct movement or via a transformation of the domain in which the data is embedded.
*Example*: Transform grid point locations, maintain connectivity.
- Domain can be spatial or temporal.
- For two images A and B, we seek a warp such that |w(A)-B| =0.
- Computing the norm typically requires a remapping step so w(A) and B are in “compatible” domains.

## Warping as metric

- Warping is most often used for registration.
- All that matters is that w(A) is approximately the same as B.
- Very little interest in the warp itself.
- The warp itself can be used as the metric that quantifies the similarity of A and B.
- Think of it as measuring how hard it is to turn one image into another.
- Warping is computationally hard (as metrics go).
- Given arbitrary A and B, what is the best w?  The w() is rarely unique in terms of |w(A)-B|, yet there is likely a minimum *cost* w().
- How does one compute a good (near min. cost) w()?
- This is where most of our research on warp methods focuses right now.

## Warping methods

- Examples seen in practice/theory:
- Elastic warping
- Curvature warping
- Fluid warping
- Particle warping
- These differ in a couple ways:
- How one computes the warp map : “flows” versus optimization problems.
- How one computes the energy/cost of the map.
- There are also subtleties in how one parameterizes the warp and cost computation based on what is known about the context of the metric.
- Tune the warp cost function based on the problem it is being applied to as a metric.
- Isotropic vs. anisotropic warps
- Optimization methods to find w() can be purely based on |w(A)-B|, or can take into account the cost of w().
- This can address the non-uniqueness of w(), but at a cost of adding complexity to the optimization to find w().

## A warp mapping example

**A warp mapping example**

- Here we show a simple example of what a warp map looks like.
- Start with an image where pixels correspond to grid cells.
- Then we displace the locations of the cell vertices to create a warped grid.
- This grid is then mapped back onto a regular grid.
- The trick here is to ensure that conservation laws are obeyed!
- ...So basic interpolation will not suffice.
- A warp cost can be computed from the warp map by computing the elastic energy of the grid distortions.
- Also need to worry about boundary conditions, isotropic/anisotropic costs.

**Notes:**
Top right image : interpolation of a flat image using the warp map.  Clearly mass did not get redistributed.
Bottom right image : interpolation via mass conservative remapping.  Mass is conserved, and displaced as one would expect from the warp map.

## Why warps?

- Intuitively, warps usually match what people do manually.
- It’s not that hard to think about the distance that a warp measures, and see how the warp came to that conclusion.
- A sequence of images that slowly change in some way relative to a reference are likely to have a similarly gradual change in warp distance to the reference.
- Traditional methods such as L2 do not exhibit this.
- An example of this follows.

## An illustrative function

- Created a basic 1-spatial, 1-time dimensional function based on a Gaussian with four `interesting’ parameters.
- Alpha: decay rate
- Beta: direction of pulse
- Gamma: rate for velocity
- Delta: decay rate for pulse width
- Has a nice feature that two parameter vectors that are “close” under warping fail to be close under *L**2* norm.

## Test function examples

- position

- time

## Examples of Curvature Warping

- simulation

- warped simulation

- residual

- reference
- “data”

## Comparison of Some Warping Costs

- Image differences were measured between a reference of ** = 0.45 and test images of 0.2<**<2.0.
- A good metric for simulation parameter estimation should be strictly convex.  Common image difference measures do not satisfy this criteria; warping metrics do.

## Simulation Optimization via Curvature Warping

- Attempt to reproduce simulation parameters given a single reference (“data”) and simulation code.
- Optimization through derivative-free multi-directional search algorithms (e.g. MDSA and NOMAD).  While we could easily use derivative-based methods, the methods need to be applicable to situations where derivatives are unavailable or costly to compute.
- Use our test function and search over the unconstrained four-dimensional parameter space {}.

## Simulation Optimization via Curvature Warping

-  About 250 function evaluations were required.
-  Residual differences and some poor parameter recovery are most likely due to interpolation deficiencies.
-  Expecting fewer (factor of ~1/2) function evaluations by employing new optimization routines.
-  Noise does degrade performance, but will not study until interpolator is complete.

## Warping status for DDMA

- Curvature, fluid, and elastic warping implementations exist.
- Curvature and fluid implementations are slow, but reasonable.
- Elastic implementation is currently very inefficient.
- Studying parameters of warp methods and exploring methods to create cost functions based on the warp mappings still largely open.
- Parallelization underway for curvature implementation.
- Code complete, but validation against sequential reference has not been completed.
- A great deal is still to be done for these methods, but they show great promise.