# Caret:Operations/Morphing

### From Van Essen Lab

## Contents |

# Morphing

A common operation in Caret is surface flattening. However, when the surface is flattened, regions in the center of the flat surface (near the ventral tip of the central sulcus) are compressed and regions around the perimeter of the surface that were adjacent to the medial wall and the cuts, are expanded. These regions of compression and expansion result in surface distortion. Surface distortion also occurs when creating a spherical surface that is often used for surface-based registration.

A surface is made up of two components, nodes and topology. Nodes are the three dimensional XYZ-coordinates scattered about the surface. Topology connects the nodes with edges (links) to form triangles. The triangles in turn form a triangular mesh. As a result, and **this is very important**, one can move the nodes in XYZ space yet preserve the topology. In Caret, one always starts with a fiducial surface that has its nodes' coordinates modified to create inflated, spherical, and flat surfaces. When creating a flat surface, a new topology is created in which the medial wall region is removed and cuts are made that radiate from the perimeter of the medial wall. Without these cuts, reducing distortion in the flat surface would be severely restricted and parts of the surface might overlay or fold over itself.

To reduce surface distortion, caret employs an operation named surface morphing. Surface morphing compares the distorted surface with the fiducial surface that represents the true cortical anatomy. With the surfaces having the same topology, each triangle has a corresponding triangle in the other surface but with differing node coordinates. The shape of the triangles in the distorted surface are modified to better match the corresponding triangles in the fiducial surface resulting in reduced distortion.

Two different distortion measurements are available, areal and linear. Areal distortion is the ratio of the surface area of a triangle in one surface compared to the surface area of the corresponding triangle in the other surface. Linear distortion is the ratio of the linear distance from one node to a neighboring node in one surface compared to the linear distance between the nodes in the other surface. During the morphing process, these two distortions are calculated. Using these distortion measurements, forces are created for each node that adjust the nodes' coordinates in order to reduce the surface distortion.

To view surface distortion in Caret, *select* **Surface Menu->Measurements->Generate Distortion**. When this command is run, surface shape columns are created that contain the areal and linear distortion measurements. When distortion is selected for display using the Display Control Dialog, the distortion is showed as shades of gray. Regions of compression are shown in a dark gray to black color and regions of expansion are shown in a light gray to white color.

## Distortion Measurements

### Areal Distortion

*A**F*_{i} = Area of triangle *i* in the fiducial surface.

*A**S*_{i} = Area of triangle *i* in the other (distorted) surface.

= Distortion for triangle *i*.

*N**T*_{j} = Number of triangles used by node *j*.

*T**A**D*_{jk} = Areal distortion for node j's k'th triangle.

= Areal distortion for node *j*.

### Linear Distortion

*D*_{ij} = Distance from node *i* to node *j*.

*N*_{i} = Number of neighbors for node *i*.

= Linear distortion for node *i*.

## Morphing Forces

### Linear Forces

LFS = Linear Force Strength

*X**Y**Z*_{i} Coordinate of node *i*.

*D**D*_{ij} = Distance from node *i* to node *j* in the distorted surface.

*D**F*_{ij} = Distance from node *i* to node *j* in the fiducial (anatomically correct) surface.

= vector formed by position of node *j* subtracted from node *j*.

= Linear force components.

*N*_{i} = Number of neighbors of node *i*.

= Linear force for node *i*.

### Angular Forces

AFS = Angular Force Strength

*X**Y**Z*_{i} = Coordinate of node *i*.

*N*_{i} = Number of neighbors of node *i*.

= Normal vector formed by nodes *i*, *j*, and *k* that make up a triangle.

*D**A**D*_{ijk} = Angle formed by node *i* and its consecutive neighbors *j* and *k* in the distorted surface.

*F**A**D*_{ijk} = Angle formed by node *i* and its consecutive neighbors *j* and *k* in the fiducial surface.

*D**i**f**f**A**D*_{ijk} = *F**A**D*_{ijk} − *D**A**D*_{ijk}Difference of angle in fiducial and distorted surfaces.

= vector formed by position of node *i* subtracted from node *j*.

*M**A**G*_{ij} = (*X**Y**Z*_{j} − *X**Y**Z*_{i}) * *s**i**n*(*D**i**f**f**A**D*_{ijk})

This creates a vector that is orthogonal to a plane formed by the vector from node *i* to node *j* and the triangle's normal vector. It indicates the direction that node *i* should be moved.

### Total Force

## Landmark Constrained Morphing

In landmark constrained morphing, nodes identified as landmarks are not morphed, that is, these node do not move. However, even though the node is not moved, its morphing forces are calculated and saved. If a node that is being morphed has a neighbor that is not being morphed the inverse force of the non-morphed neighbor is added to the node being morphed.

### Visualizing Forces

After running morphing, one can view the forces on a surface using the Surface Miscellaneous page of the Display Control Dialog. On this page are selections for displaying the angular, linear, and/or total forces.

### Running Surface Morphing

*Select* **Surface->Morphing->Morph Flat Surface** or **Surface->Morphing->Morph Spherical Surface**.

## Multi-Resolution Morphing

Since morphing can be a slow process, Caret run's multi-resolution morphing. During this process, the surface is subsampled (many nodes are removed) and a low resolution surface is created. This subsampled surface is then morphed. The results are then upsampled to a higher resolution surface that is then morphed. Using these multiple resolutions, typically five, substantially reduces the execution time yet yields a surface with significantly reduced distortion.

The multi-resolution morphing process runs in multiple cycles that follow morphing with smoothing. Morphing may create some crossovers and smoothing usually eliminates these crossovers.

### Running Multi-Resolution Morphing

*Select* **Surface->Morphing->Multiresolution Morphing Flat Surface** or **Surface->Morphing->Multiresolution Spherical Surface**.