Example e41: Variable Length Scaling Customisation of Full Torso Model

This example takes the full male torso model and customises each region. Three length measurements and five circumferential measurements are used to customise the outer torso surface using a 3rd order polynomial applied down the length of the torso. A percentage body fat in terms of volume calculated using the Sloane-Weir equation and 4 skinfold measurements is used to customise the fat-muscle interface surface and define the fat layer. Basic length and radial scaling is applied to the torso cavity surface to define the muscle layer and torso cavity. Digitised MRI images were used to define how the heart and lung regions are customised. For more information refer to Joanne Crocombe's Masters Thesis (1997).


The comfile run by this example is as follows:

# Example e41
# -----------
#


#----------------------------------------------------------#
#
# Customising the Full Torso
# This example uses the full 'generic' torso model and 
# customises each region using measurements taken from a 
# volunteer to give a better model for that individual. 
# This example is not run nightly as some of the 
# optimisation steps take a while to run.
#
#----------------------------------------------------------#


fem def para;r;full_body;example             #Read in parameter file.
fem def coor 3,1                             #Define 3-d coordinate system.
fem def base;r;;example                      #Define bicubic Hermite and sector 
#                                            # basis functions.
fem def regi;r;;example                      #Define six regions for full torso.
fem def node;r;;example region all           #Read in nodes for all regions.
fem def elem;r;;example region all           #Read in elements for all regions.
fem def fiel;r;;example region all           #Read in field of geometry.
fem def elem;r;;example field region all     #Read in element field.
fem update field from geometry region all    #Update field from initial torso 
#                                            # geometry.


#
#----------------------------#
# Customise outer layer
#----------------------------#
#
fem def opti;r;outer_torso;example           #Read in optimisation parameters to 
#                                            # customise the outer surface. This 
#                                            # file specifies the number of 
#                                            # polynomial and cosine coefficients 
#                                            # to be used. Also defines torso 
#                                            # lengths and circumferential
#                                            # measurements from the patient torso.  
#
optimise                                     #Carries out NPSOL non-linear 
#                                            # optimisation. Optimisation takes
#                                            # about 10 minutes.
#
fem update field from geometry               #Updates the field to incorporate customised
#                                            # outer surface.
#


#
#----------------------------#
# Customise fat layer
#  This takes ages (> 3 hrs) 
#  so remove for now 
#----------------------------#
#
fem def opti;r;fat_layer;example             #Read in optimisation parameters to 
#                                            # customise the fat layer. Specifies 
#                                            # the number of coefficients to be 
#                                            # used and the desired percentage 
#                                            # body fat in terms of volume not 
#                                            # mass.
#
#optimise                                    #Carries out NPSOL non-linear 
#                                            # optimisation. Optimisation takes 
#                                            # about an hour because there are a
#                                            # large number of polynomial terms
#                                            # used to customise it and at each
#                                            # step each node in the fat-muscle 
#                                            # surface is checked to make sure its 
#                                            # still inside the outer torso surface.
#
fem update field from geometry               #Updates the field to incorporate 
#                                            # customised fat-muscle interface 
#                                            # surface.
#
fem def cust;r;muscle_layer;example          #Read in a customisation parameters 
#                                            # for muscle layer. Same length 
#                                            # scaling as for fat layer and the 
#                                            # first polynomial coeff which is 
#                                            # just a radial scaling from the 
#                                            # fat layer customisation is used 
#                                            # to scale.
fem change mesh region 3                     #Applies the customisation parameters 
#                                            # to the torso cavity surace region 3.
#
fem update field from geometry               #Updates the field to incorporate 
#                                            # customised torso cavity surface.


#
#                                            #The heart surface was customised 
#                                            # by eye by comparison with 
#                                            # digitised point of the heart and
#                                            # body surface from 3 orthogonal
#                                            # MRI images. The lungs were each 
#                                            # grouped into two regions. The 
#                                            # region surrounding the heart or
#                                            # cardiac notch and the rest of the
#                                            # lung. The cardiac notch region of
#                                            # each lung is moved in the same 
#                                            # way as the heart to maintain 
#                                            # correct spacing between the 
#                                            # surfaces. The outer lung surfaces
#                                            # were scaled by same factor as fat 
#                                            # and muscle.


# Grouping specific nodes
#
fem group nodes 919..955 as heart region 6   #Grouping nodes for heart and lungs. 
fem group nodes 854,858,862,867..870,875..878,883..885 as rlnotch region 5
fem group nodes 768..772,776..780,784..788,792..796,800..804 as llnotch reg 4
fem group nodes 763..767,773..775,781..783,789..791,797..799,805..840 as llout reg 4
fem group nodes 841..853,855..857,859..861,863..866,871..874,879..882,886..918 as rlout reg 5


#
#----------------------------#
# Rotate heart and lung 
#  cardiac notch nodes
#  according to MRI data
#----------------------------#
#
fem change nodes rotate by -4 axis 1,0,0 no heart reg all
fem change nodes rotate by -4 axis 1,0,0 no rlnotch reg all
fem change nodes rotate by -4 axis 1,0,0 no llnotch reg all
fem change nodes rotate by -4 axis 0,1,0 no heart reg all
fem change nodes rotate by -4 axis 0,1,0 no rlnotch reg all
fem change nodes rotate by -4 axis 0,1,0 no llnotch reg all


#
#----------------------------#
# Translate heart and cardiac 
#  notch nodes
#----------------------------#
#
fem change nodes translate by 2,1,-4 no heart reg all
fem change nodes translate by 2,1,-4 no rlnotch reg all
fem change nodes translate by 2,1,-4 no llnotch reg all


#
#----------------------------#
# Scale heart and cardiac 
#  notch node
#----------------------------#
#
fem change nodes scale by 1,1,1.05 no heart reg all 
fem change nodes scale by 1,1,1.05 no rlnotch reg all
fem change nodes scale by 1,1,1.05 no llnotch reg all 


#
#----------------------------#
# Scale outer lung nodes
#----------------------------#
#
fem change nodes scale by 0.96,0.96,0.96 no rlout reg all
fem change nodes scale by 0.96,0.96,0.96 no llout reg all


#
#----------------------------#
# Export geometry
#----------------------------#
#
fem export nodes;full_body reg all            

Additional testing commands:

fem change mesh meas 1 change             #Evaluates circumferential 
#                                            # measurement around new mesh at 
#                                            # height of 1mm. 
fem change mesh meas 67  change
fem change mesh meas 150 change
fem change mesh meas -80 change
fem change mesh meas 0   change
fem li no no 1..20                           #Lists the first 20 node values.

Files used by this example are:

Name                 Modified     Size

example_e41.com 20-Nov-2001 7.5k fat_layer.ipopti 19-Mar-2002 3.6k full_body.ipbase 10-Apr-2000 4.5k full_body.ippara 12-Nov-2002 5.9k full_body.ipregi 10-Apr-2000 116 full_body.irelem 10-Apr-2000 327k full_body.irelfd 10-Apr-2000 249k full_body.irfiel 10-Apr-2000 736k full_body.irnode 10-Apr-2000 838k muscle_layer.ipcust 10-Apr-2000 786 outer_torso.ipopti 19-Mar-2002 3.5k test_output.com 17-Dec-2001 418

Download the entire example:

Name                      Modified     Size

examples_e_e4_e41.tar.gz 19-Aug-2006 440k

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmSuccessSun Mar 6 00:17:22 201627
mips-irix
cmSuccessThu Aug 16 05:46:56 2007488
cm-debugSuccessWed Nov 14 11:22:15 20011990
cm-debug-clear-mallocSuccessThu Nov 15 13:17:05 20012021
cm64SuccessThu Aug 16 05:42:16 2007485
rs6000-aix
cmSuccessWed Mar 4 01:26:12 200953
cm64SuccessWed Mar 4 01:27:56 200960

Testing status by file:


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

Input last modified: Tue Nov 12 12:39:58 2002


CMISS Help / Examples / e / e4 / e41