# Problem

How to transfer data from the individual (A) onto the Low-Resolution FreeSurfer Average Combined Atlas (D).

• A The individual subject in its native mesh and space. Note that sphere.reg is the individual's mesh in B's space.
• B FreeSurfer Average Left Hemisphere or Right Hemisphere Atlas
• C FreeSurfer Average Hybrid Left/Right High-Resolution Atlas
• D FreeSurfer Average Hybrid Left/Right Low-Resolution Atlas

Deformations from A to B and B to C have been performed. D is a resampled version of C.

A naive solution is to perform several successive data file deformation operations to get data from A to D. However, this results in the data being resampled several times and may degrade the quality of the data. Instead, a single deformation map for transferring data from A to D (or D to A) is created using two caret_command operations.

# Operations

## Projection and Unprojection

Projection involves the conversion of a three-dimensional Cartesian coordinate into a Barycentric coordinates. This Barycentric coordinate is a relative location within a triangle and consists of weights associated with each of the triangle's three nodes. The triangle can be moved or its shape changed, but the object at the barycentric coordinate retains its relative position in the triangle. Unprojection is the conversion of a Barycentric coordinate to a Cartesian coordinate.

## Caret Surface-Based Registration

During Caret's surface-based registration from SOURCE to TARGET, the nodes of the SOURCE spherical surface are moved so that the landmark borders on the SOURCE spherical surface align with the corresponding landmark borders on TARGET spherical surface. At this point the SOURCE mesh (topology) has not changed but the SOURCE nodes have been moved so that the SOURCE geography aligns with the TARGET geography. This new SOURCE spherical surface is the DEFORMED_SOURCE surface. It is located in the SOURCE directory and its name is the same as the original SOURCE spherical surface with the addition of the prefix "deformed_". For example, if the source sphere is "Human.1582.L.Full.SPHERE.STD.CleanMW.65950.coord", the deformed source sphere is named "deformed_Human.1582.L.Full.SPHERE.STD.CleanMW.65950.coord". The SOURCE_TO_TARGET deformation map is created by projecting the TARGET spherical surface nodes to the DEFORMED_SOURCE spherical surface and the TARGET_TO_SOURCE deformation map is created by projecting the DEFORMED_SOURCE spherical surface nodes to the TARGET spherical surface. Also see Algorithm for All Registration Operations.

## FreeSurfer Registration

The FreeSurfer registration process creates sphere.reg (DEFORMED_SOURCE) which is the individual's mesh, aligned fsaverage_L (or fsaverage_R).

# Solution

The goal is to create deformation maps between A's mesh and D's mesh. There is no resampling, we just non-linearly transform A's nodes using projection and unprojection.

## Preconditions

• The FreeSurfer registration process created sphere.reg which is A's mesh in B's space.
• Caret surface-based registration has been performed from B to C. As a result, in B's directory is B's DEFORMED_SOURCE which is B's mesh in C's space.

## Algorithm

1. Since sphere.reg is in B's space, project each node from sphere.reg to B's SOURCE spherical surface creating barycentric coordinates in B's triangles.
2. Unproject the barycentric coordinates using B's DEFORMED_SOURCE surface which creates an A-mesh in C's space.
3. Since C and D are in the same space (C and D are aligned but have a different number of nodes) and A's mesh is now in C's space, 'caret-command -deformation-map-create' can now be used to create deformation maps between A and D.

## Caret Commands

### caret_command -surface-sphere-project-unproject

```caret_command -surface-sphere-project-unproject \
sphere.reg.coord \
sphere.reg.topo \
OUTPUT.sphere.coord \
fsaverage_L.coord \
deformed_fsaverage_L.coord \
fsaverage_L.topo
```

### Run caret_command -deformation-map-create

```caret_command -deformation-map-create \
SPHERE \
OUTPUT.sphere.coord \
sphere.reg.topo \
fsaverage_hybrid_low_res_L.coord \
fsaverage_hybrid_low_res_L.topo \
indiv_to_fsaverage_low_res_L.deform_map
```