Example d32: Host-mesh customisation of a femur

This example illustrates host-mesh fitting of a femur using 24 control points

Customised femur Closeup showing control points
Fig. 1 Customised femur (yellow-generic, red-customised) Fig. 2 Closeup showing control points


The comfile run by this example is as follows:

#
# This example illustrates customisation of a femur using 24 anatomical 
# control points and a three-element tricubic Hermite host-mesh.
#

# Define variables
$SLAVE= "femur_slave"
$CUST_SLAVE = "femur_cust"
$HOST = "host"
$CUST_HOST = "host_cust"
$LANDMARK = "femur_landmark"
$TARGET = "femur_projection"
$HOST_REG = 2
$SLAVE_REG= 1

fem def para;r;fitting;example #fitting parameters
fem def regi;r;two;example #2 regions
fem def coor 3,1 #3D rectangular cartesian
fem def base;r;bicubic_tricubic;example # bases functions

###################################################

# The slave mesh
fem def node;r;$SLAVE;example reg $SLAVE_REG
fem def elem;r;$SLAVE;example reg $SLAVE_REG
#fem export node;$SLAVE as $SLAVE offset 19000 reg $SLAVE_REG
#fem export elem;$SLAVE as $SLAVE offset_elem 19000 reg $SLAVE_REG

###################################################

# The host mesh
fem def node;r;$HOST;example reg $HOST_REG
fem def elem;r;$HOST;example reg $HOST_REG
fem up node deriv 1 reg $HOST_REG
fem up node deriv 2 reg $HOST_REG
fem up node deriv 3 reg $HOST_REG

# Refine host mesh
fem ref xi 3 elements 2300 at 0.25 reg $HOST_REG
fem ref xi 3 elements 2301 at 0.65 reg $HOST_REG 
#fem export node;$HOST as $HOST offset 12000 reg $HOST_REG
#fem export elem;$HOST as $HOST offset_elem 12000 reg $HOST_REG

###################################################

# Calculate xi's for generic data points
fem def data;r;$LANDMARK;example
fem def xi;c contain reg $HOST_REG
#fem export data;$LANDMARK as $LANDMARK error offset 16000
#fem def xi;w;$LANDMARK reg $HOST_REG

# Calculate xi's for node points
fem def xi;c nodes contain of $SLAVE_REG in $HOST_REG
#fem def xi;w;generic nodes contain of $SLAVE_REG in $HOST_REG

###################################################

# Fit the host mesh
fem def data;r;$TARGET;example
fem def xi;r;$LANDMARK;example reg $HOST_REG
#fem export data;$TARGET as $TARGET error full offset 17500

fem def field;r;$HOST;example reg $HOST_REG
fem def elem;r;$HOST;example field reg $HOST_REG
fem def fit;r;$HOST;example geom reg $HOST_REG

fem fit reg $HOST_REG

###################################################

# Update the slave mesh
fem def xi;r;generic;example nodes of $SLAVE_REG in $HOST_REG
fem update mesh position fit of $SLAVE_REG in $HOST_REG 

#fem export node;$CUST_SLAVE as $CUST_SLAVE offset 20000 reg $SLAVE_REG
#fem export elem;$CUST_SLAVE as $CUST_SLAVE offset_elem 20000 reg $SLAVE_REG

#fem def nodes;w;femur_cust
#fem def elem;w;femur_cust

###################################################

# Update the host mesh
fem update nodes fit reg $HOST_REG

#fem export nodes;$CUST_HOST as $CUST_HOST offset 27000 reg $HOST_REG
#fem export elements;$CUST_HOST as $CUST_HOST offset_elem 27000 reg $HOST_REG



Additional testing commands:



Files used by this example are:

Name                     Modified     Size

example_d32.com 31-Jan-2005 2.7k backup.ipfit 13-Apr-2007 5.3k bicubic_tricubic.ipbase 11-Aug-2004 7.7k check_fit.com 31-Jan-2005 408 femur4.exdata 31-Jan-2005 131k femur4.ipdata 31-Jan-2005 169k femur_cust.exelem 31-Jan-2005 254k femur_cust.exnode 31-Jan-2005 129k femur_cust.ipelem 31-Jan-2005 136k femur_cust.ipnode 31-Jan-2005 356k femur_landmark.exdata 31-Jan-2005 2.7k femur_landmark.ipdata 11-Aug-2004 1.7k femur_landmark.ipxi 31-Jan-2005 2.0k femur_projection.ipdata 11-Aug-2004 1.7k femur_slave.exelem 31-Jan-2005 254k femur_slave.exnode 31-Jan-2005 129k femur_slave.ipelem 11-Aug-2004 134k femur_slave.ipnode 11-Aug-2004 368k fitting.ippara 11-Aug-2004 6.0k generic.ipxi 31-Jan-2005 33k host.exelem 31-Jan-2005 11k host.exnode 31-Jan-2005 10k host.ipelem 11-Aug-2004 432 host.ipelfd 31-Jan-2005 935 host.ipfiel 11-Aug-2004 13k host.ipfit 13-Apr-2007 5.3k host.ipnode 11-Aug-2004 12k host_cust.exelem 31-Jan-2005 14k host_cust.exnode 31-Jan-2005 20k test_output.com 22-Aug-2004 0 two.ipregi 11-Aug-2004 93 view.com 11-Aug-2004 4.8k

Download the entire example:

Name                      Modified     Size

examples_d_d3_d32.tar.gz 14-Apr-2007 425k

Testing status by version:

StatusTestedReal time (s)
hpc_cmo64_irixSuccessSun Jul 31 01:35:25 200512
rs6000-aix
cm64SuccessWed Mar 4 01:10:58 20094
x86_64-linux
cmSuccessSun Mar 6 00:01:12 20162

Testing status by file:


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

Input last modified: Fri Apr 13 10:41:25 2007


CMISS Help / Examples / d / d3 / d32