This example uses the command "fem fit in_plane". It is meant to be used in the following case: An initial mesh is fitted to the structure at time T0, in this example the cube. In 2D images of the structure, data points are traced between the initial state and the deformed state (T1). A point p0 at the initial state corresponds to point p1 in the deformed state. Since the image-plane is fixed in space and time, p1 may not be the material point p0 as it is likely to move out of the image-plane. p1 may rather be an approximation of the projection of the material point onto the image-plane at T1. In a standard fitting the structure would move only in the direction of the p1-p0 direction in the imaging plane and we would miss out on the out-of-plane motion. The "in_plane" option of the fit command takes care of that by ignoring any error-component that is along the image-plane normal vector given as the weights of the data point in the ipdata file.

In this example we have a cube that is purely translated dx=-0.2, dy=0, dz=0.2. The first 8 data-points landmark.ipdata are in imaging planes parallel to the xy-plane. As is seen in the target.ipdata these points miss the dz translation. The last 8 data points are parallel to the yz-plane and they thus have no dx translation. In a standard fitting procedure we would only get half of the true translation as half the points say we are moving -0.2 in x-direction and the other half says no movement in x-direction. The same is the case for the movement in the z direction. (Running this example with $nFits=1 in the com-file will produce that result.)

This is a non-linear fitting problem and it is done by running several iterations of the fit, each being a piece-wise linear fit.

Created by Espen Remme April 2003.