Example e43: Finite Element Geometric Fitting To Epicardial Data

Geometric data obtained from digitised ultrasound images are fitted using the finite element fitting technique. The data point are projected onto the intial mesh surface and this distance minimised.

Initial Mesh Fitted Mesh

Results can be view with draw.com.

Created by : Leo Cheng
On : 16 September 2000


The comfile run by this example is as follows:



$MODEL 	= "epi_ref0"
$OUTPUT = "epi_ref0c"
$FITNAME = "epi"





fem def para;r;fitting_lin;example
fem def coor 3,1


#
# Sets up three basis functions 
#   - 1 standard bicubic Hermite element
#   - 2 simplex element collapsed at x2=0
#   - 3 simplex element collapsed at x2=1
#
fem def base;r;bicubic_fit;example

#
# Reads in an initial mesh and calculates linear approximations
#  for the derivatives in xi=1 and 2 directions
#
fem def node;r;$MODEL;example
fem def elem;r;$MODEL;example
fem up node deriv 1 linear
fem up node deriv 2 linear

#
# The initial mesh
#
fem export node;${FITNAME}_init as ${FITNAME}_init offset 40000
fem export elem;${FITNAME}_init as ${FITNAME}_init offset_elem 40000


#
# Calculate the intial xi projections 
#   - alternatively the command fem def xi;c orthog can be used
#     it is slower but may produce better results in some cases
#
fem def data;r;$FITNAME;example
fem def xi;c close
fem li data err 
fem export data;${FITNAME}_data as ${FITNAME}_data error


#
# Setup the fitting problem - 
#  NOTE - alternatively it may be easier use the commands
#  "fem up field from geometry" to setup these fields automatically
#
fem def field;r;epi;example
fem def elem;r;epi;example field

#
# Defines the fitting problem by setting smoothing parameters
#  and setting some fixed nodes.
#
fem def fit;r;epi2;example geometry


Additional testing commands:


#
# First fit
#
fem fit
fem update node fit
fem update scale_factor normalise
# The `old' option on `def xi;c' means that the last projections are used as
# initial estimates for the non-linear projection calculation.
fem def xi;c close old
fem li data err 

#
# Second fit
#
fem fit
fem update node fit
fem update scale_factor normalise
fem def xi;c close old
fem li data err 

#
# Third fit
#
fem fit
fem update node fit
fem update scale_factor normalise
fem def xi;c close old
fem li data err 


#
# Export the fitted geometry
#
fem export data;${FITNAME}_data as ${FITNAME}_data error
fem export node;$FITNAME as $FITNAME offset 30000
fem export elem $FITNAME as $FITNAME offset_elem 30000


Files used by this example are:

Name                Modified     Size

example_e43.com 12-Dec-2000 1.3k bicubic_fit.ipbase 16-Sep-2000 3.9k epi.ipdata 16-Sep-2000 116k epi.ipelfd 16-Sep-2000 18k epi.ipfiel 16-Sep-2000 127k epi2.ipfit 13-Apr-2007 3.0k epi_ref0.ipelem 16-Sep-2000 23k epi_ref0.ipnode 16-Sep-2000 45k fitting_lin.ippara 12-Nov-2002 5.9k test_output.com 08-Dec-2000 696

Download the entire example:

Name                      Modified     Size

examples_e_e4_e43.tar.gz 27-Aug-2010 224k

Testing status by version:

StatusTestedReal time (s)
cm_linux_optimisedSuccessTue Oct 8 03:47:08 200240
cmo_n32SuccessTue Oct 8 14:20:19 200229
i686-linux
cmSuccessSun Mar 6 00:03:17 20163
cm-debugSuccessSat Mar 5 00:18:10 20169
mips-irix
cmSuccessSun Aug 19 01:57:07 200727
cm-debugSuccessWed Aug 15 02:02:17 200789
cm-debug-clear-mallocSuccessSat Aug 18 02:19:55 200793
cm-debug-clear-malloc7SuccessMon Aug 20 02:17:01 200793
cm64SuccessSun Aug 19 01:59:17 200728
cm64-debugSuccessTue Aug 21 02:05:03 200798
cm64-debug-clear-mallocSuccessThu Apr 1 12:08:58 200440
rs6000-aix
cmSuccessWed Mar 4 01:10:58 20093
cm-debugSuccessMon Mar 2 01:14:36 200927
cm64SuccessWed Mar 4 01:10:02 20093
cm64-debugSuccessTue Mar 3 01:19:27 200928
x86_64-linux
cmSuccessSun Mar 6 00:01:07 20161
cm-debugSuccessSat Mar 5 00:01:56 20164

Testing status by file:


Graphical output from this problem is given here.


Html last generated: Sun Mar 6 05:51:27 2016

Input last modified: Thu Aug 26 14:53:07 2010


CMISS Help / Examples / e / e4 / e43