Given a family of objects, the atlas model proposes to learn a template shape which corresponds to a mean of the objects, as well as to compute a low number of coordinates for each object from this template shape. A complete description of the mathematics of the deterministic atlas is given on the LDDMM page, including its loss function.
The figure below describes the deterministic atlas model.
A toy example
We need to configure the three different xml files: model.xml, data_set.xml, optimization_parameters.xml. We follow here the examples/atlas/landmark/2d/skulls example.
The model.xml file
This file requires:
The name of the model. Here for atlas it must be set to 'DeterministicAtlas': <model-type>DeterministicAtlas</model-type>.
The dimension: 2 for 2D images or 2D meshes (which is the case here) and 3 for 3D images of 3D meshes
The template section: this section defines the list of objects considered in the computation. In our case, a single polyline object is considered, so that there is a unique section in the template section.
The deformation-parameters section. In our case we only need:
the kernel-width: controls the typical width of the deformation as explained in the LDDMM page.
the kernel-type: can be set to keops or torch. For a large number of control points, keops is advised.
Details about how to construct a general model xml file are available here.
The data_set.xml file
This file contains the paths to all the objects. Each observation is a subject section with a subject id. Each subject section contains a single visit which contains the list of filenames, with the id of the shape as attribute. In our example, a subject looks like:
This will run the estimation and save output in the output folder. In this output, there will be:
Every reconstructed shape. Their name contains __Reconstruction__, the id of subject and of the shape.
The estimated template: one file for each shape of the template.
The set of control points used, in txt format. A standard initialization is used, and they are fixed by default during the optimization, although it is also possible to estimate them by setting <freeze-cp>Off</freeze-cp> in the optimization_parameters.xml file.
The set of momenta used, in txt format. Each paragraph of this file is the set of momenta used for one subject. They can be used to perform statistical tasks on a population.
The residuals of the fit: the list of distances between the targets and the reconstructed objects.
A note on pre-processing
In general, we advise to have the shapes rigidly aligned before running an atlas. It is also advised to use a relevant initialization for the initial template shape e.g. using one of the observations.