Atlas Construction (2)


In this tutorial, we will see how to build an atlas from a set of 3 anatomical configurations made of 2 brain structures each: the hippocampus and the amygdala..What you need is a terminal to run Deformetrica. We will use Paraview to visualize data and results.

Data and scripts are in the folder deformetrica-[version]/tutorials/AtlasConstruction2/.


1. The data:

  • Data are in files hippo{s}.vtk, amygdala{s}.vtk for s=1,2,3.
  • You can open the files in Paraview.

2. Pre-processing and design choices

  • Here again, the anatomical configurations have been co-registered, using affine transforms.
  • As we deal with surface mesh, we choose the data representation as NonOrientedSurfaceMesh.
  • To build an atlas, we need a prototype shape for the hippocampus and the amygdala. We will use an ellipsoid mesh. To this goal, we will deform a sphere, so that its center will be at the center of mass of the data and the main axis of the ellipsoid will be in the direction of the principal component of the data set. This is done using the command-line MapsEllipsoidWithSource in the folder utilities and the spherical meshes provided in the same folder. To do it, simply execute the script ./ in the Terminal. The script produces the vtk files hippo_prototype.vtk and amyg_prototype.vtk which you can open in Paraview.

3. Run Deformetrica

  • Parameters can be found in paramDiffeos.xml for the deformation parameter settings and in paramHippo.xml and paramAmyg.xml for the object parameter settings for both objects.
  • Run in terminal the script ./
  • We notice that the regularity term during the execution increases and then decreases, thus suggesting good convergence of the template. If it is not the case, consider increasing the data-sigma of the objects.

4. Output and results

  •  The algorithm generates a number of output files:
    • hippo_prototype_template.vtk and amyg_prototype_template.vtk are the files of the updated template shapes,
    • CP_final.txt contains the optimal positions of the control points in space,
    • MOM_final.txt is a multi-momenta file, which contains 3 sets of momentum vectors, each set parameterizing a deformation, which warps the template to each anatomical configuration. You can run the script generateVTKmomenta.m in Matlab to generate a vtk file named Momenta.vtk, which will display the momenta once opened in Paraview.
    • Several .vtk files showing the deformation of the template to each anatomical configuration (they can be loaded as movies in Paraview)
  • Of course, you can use spherical mesh with more faces to have template estimated at finer resolution.

The following figure has been obtained by opening in Paraview:

  • hippo_prototype_template.vtk and amyg_prototype_template.vtk
  • Momenta.vtk
  • to this latter we applied the Glyph filter (Filters->Alphabetical->Glyph) and set the scale factor to 7.
  • To see the movie of the deformation of the template to the anatomical configuration of the first subject, open hippo_prototype_to_subject_0__t_*.vtk and amyg_prototype_to_subject_0__t_*.vtk and then click on “Play” (top panel on the middle).


5. About how to use the atlas

Once the atlas built, we would like to assess if a new subject falls in the typical variability range of the population used to built the atlas. In the current folder, there are two more files that we have left out so far: hippo4.vtk and amygdala4.vtk, which will play the role of the data of a test subject.

To compare this new data with the atlas, the only thing we need to do is to register the atlas to the new subject’s data. Be careful, that you need to keep the same set of control points as the one in the atlas. The momentum vectors that parameterize the registration should be attached to the same control points as the momentum vectors that parameterize the atlas-to-subjects deformations in the atlas.

To do this, we use the same paramDiffeos.xml file, except that we set:

  • <initial-cp-position>Results_atlas/CP_final.txt</initial-cp-position>, so that the same positions of control points we be given as initialization of the optimization method, and
  • <freeze-cp>On</freeze-cp>, so that the positions of control point will not be updated during the optimization.

We name this new file: paramDiffeosRegistration.xml. To run the registration, simply execute the script ./ It will:

  • move the output of the atlas construction in a sub-folder named Results_atlas/,
  • execute sparseMatching3 for atlas-to-new-subject registration

Outputs are:

  • CP_final.txt, which should be exactly the same as the one in Results_atlas,
  • Mom_final.txt, which contain the value of the momentum vectors, which could be compared to the mean and covariance matrix of the momentum vectors in Results_atlas/Mom_final.txt
  • the files hippo_prototype_template__t_*.vtk and amyg_prototype_template__t_*.vtk, which can be opened in Paraview to see the movie of the deformation of the atlas to the data of this new subject:



Comments are closed.