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.
#Example_21j Fitting volume element to image-plane data where out of plane error is ignored fem def para;r;fitting;example; # Declares array dimensions fem def coord;r;rcCoord;example; # Defines the coordinate system fem define base;r;3Lin;example; # Defines tri-linear Hermite basis functions $name="cube" fem def node;r;$name;example; # Reads in nodal information fem def elem;r;$name;example; # Reads in element information # Export original geometry to view in Cmgui fem export node;$name as $name offset 100 fem export elem;$name as $name offset_elem 100 fem def data;r;landmark;example; # Defines the data-points for time T0 fem def xi;c contain # Calculates the xi positions of the data points inside the mesh fem def xi;w;landmark # Writes the xi positions to file fem export data;landmark as landmark offset 100 fem def data;r;target;example; # Defines the data-points for time T1 (deformed state) fem def xi;r;landmark # Read in the xi-positions to calculate error between landmark and target points fem export data;target as target error offset 200 fem update field from geometry # Prepare the field variables fem def fit;r;fitCube;example geom # Setting the fit options fem fit in_plane # execute the fit with the in_plane option, i.e. ignoring out-of-plane movement of the data-point $nFits=5 # Set the number of fit iterations for($n=2;$n<=$nFits;$n++) { print "\n\n\************************************\n" print "\n\n\Fit number $n\n" print "\n\n\************************************\n" fem update node fit fem def data;r;landmark;example; $name = "newLandmark"; fem define data;c from_xi fem define data;w;$name fem update field from geometry fem def data;r;newLandmark fem def xi;c contain fem def xi;w;landmark fem def data;r;target;example; fem def xi;r;landmark fem def fit;r;fitCube;example geom fem fit in_plane } # Update the geometry, write it to file and export it to be viewed in CMGUI fem update node fit $name = "transformed_cube" fem def node;w;$name fem def elem;w;$name fem export node;$name as $name offset 000 fem export elem;$name as $name offset_elem 000 # Write the final positions of the data points to file and export them to be viewed in CMGUI fem export data;projections as projections error offset 300 fem def data;r;landmark;example; $name = "finalDataPts"; fem define data;c from_xi fem define data;w;$name fem export data;$name as $name error offset 0
Name Modified Size
example_21j.com 07-Apr-2003 2.5k 3Lin.ipbase 02-Apr-2003 4.2k cube.ipelem 02-Apr-2003 479 cube.ipnode 02-Apr-2003 1.8k draw.com 02-Apr-2003 1.3k fitCube.ipfit 13-Apr-2007 1.6k fitting.ippara 07-Apr-2003 5.9k landmark.ipdata 02-Apr-2003 1.2k rcCoord.ipcoor 02-Apr-2003 678 target.ipdata 02-Apr-2003 1.2k test_output.com 07-Apr-2003 0
Name Modified Size
examples_2_21_21j.tar.gz 14-Apr-2007 8.2k
Status | Tested | Real time (s) | |
i686-linux | |||
cm | Failure | Sun Mar 6 00:04:58 2016 | 0 |
last break | Thu Sep 27 00:20:00 2012 | 2 | |
last success | Sun Feb 6 00:47:00 2011 | 1 | |
cm-debug | Failure | Sun Mar 6 00:04:59 2016 | 0 |
last break | Thu Sep 27 00:20:00 2012 | 1 | |
last success | Fri Feb 18 01:09:00 2011 | 1 | |
mips-irix | |||
cm | Success | Sun Aug 19 01:29:50 2007 | 4 |
cm-debug | Success | Wed Aug 15 01:25:13 2007 | 7 |
cm-debug-clear-malloc | Success | Sat Aug 18 01:27:40 2007 | 11 |
cm-debug-clear-malloc7 | Success | Mon Aug 20 01:25:00 2007 | 12 |
cm64 | Success | Sun Aug 19 01:29:00 2007 | 4 |
cm64-debug | Success | Tue Aug 21 01:22:57 2007 | 7 |
cm64-debug-clear-malloc | Success | Thu Apr 1 10:11:55 2004 | 4 |
rs6000-aix | |||
cm | Success | Wed Mar 4 01:06:52 2009 | 1 |
cm-debug | Success | Mon Mar 2 01:06:53 2009 | 1 |
cm64 | Success | Wed Mar 4 01:06:52 2009 | 1 |
cm64-debug | Success | Tue Mar 3 01:12:04 2009 | 2 |
x86_64-linux | |||
cm | Failure | Sun Mar 6 00:01:23 2016 | 0 |
last break | Thu Sep 27 00:23:00 2012 | 1 | |
last success | Sun Mar 6 00:25:00 2011 | 0 | |
cm-debug | Failure | Sun Mar 6 00:01:23 2016 | 0 |
last break | Thu Sep 27 00:24:00 2012 | 2 | |
last success | Fri Feb 18 00:28:00 2011 | 1 |
i686-linux | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
mips-irix | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
Success | cm-debug-clear-malloc: | cmiss_test.log.retain. | |
Success | cm-debug-clear-malloc7: | cmiss_test.log.retain. | |
Success | cm64: | cmiss_test.log.retain. | |
Success | cm64-debug: | cmiss_test.log.retain. | |
Success | cm64-debug-clear-malloc: | cmiss_test.log.retain. | |
rs6000-aix | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. | |
Success | cm64: | cmiss_test.log.retain. | |
Success | cm64-debug: | cmiss_test.log.retain. | |
x86_64-linux | |||
Success | cm: | cmiss_test.log.retain. | |
Success | cm-debug: | cmiss_test.log.retain. |
i686-linux | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
mips-irix | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug-clear-malloc: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug-clear-malloc7: | ndiff test: no significant differences with generic answer. | |
Success | cm64: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug-clear-malloc: | ndiff test: no significant differences with generic answer. | |
rs6000-aix | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm64: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug: | ndiff test: no significant differences with generic answer. | |
x86_64-linux | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. |
i686-linux | |||
Failure | cm: | ndiff test: significant differences with generic answer. | |
Failure | cm-debug: | ndiff test: significant differences with generic answer. | |
mips-irix | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug-clear-malloc: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug-clear-malloc7: | ndiff test: no significant differences with generic answer. | |
Success | cm64: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug-clear-malloc: | ndiff test: no significant differences with generic answer. | |
rs6000-aix | |||
Success | cm: | ndiff test: no significant differences with generic answer. | |
Success | cm-debug: | ndiff test: no significant differences with generic answer. | |
Success | cm64: | ndiff test: no significant differences with generic answer. | |
Success | cm64-debug: | ndiff test: no significant differences with generic answer. | |
x86_64-linux | |||
Failure | cm: | ndiff test: significant differences with generic answer. | |
Failure | cm-debug: | ndiff test: significant differences with generic answer. |
Html last generated: Sun Mar 6 05:50:11 2016
Input last modified: Fri Apr 13 10:31:07 2007