Example 971: Fitting of tri-cubic volume meshes of human lung lobes

This example illustrates the fitting of tri-linear initial volume meshes of the human lung lobes to the data obtained from the visible human anatomical sections to create tri-cubic (Hermite) volume meshes. Data points are projected on to the faces of the volume elements and the face parameters that minimise the sum of the square of the error(Euclidean distance) are determined. Sobelov smoothing is also incorporated as a penalty function to the objective function to control the excessive curvature of arcs and surfaces of the faces. For more details of face fitting see examples 21g and 21h and for the details of theoretical analysis of fitting see Geometric modeling of the human torso using cubic hermite elements, Bradley et. al.

The com file in this example is only for fitting of left upper lobe. For fitting of other lobes use the following com files.

left_lower.com , right_upper.com , right_middle.com , right_lower.com . All necessary input files can be found at the end of this page.

Created by Kumar Mithraratne.

Initial Linear Volume Mesh

Anterior View of Fitted Lobes

Posterior View of Fitted Lobes

The comfile run by this example is as follows:

${lobe} = 'left_upper'

fem def para;r;all_lobe;example 
fem def coord;r;all_lobe;example 
fem def base;r;all_lobe_cubic;example 
fem def node;r;${lobe};example  
fem def elem;r;${lobe};example 

fem update nodes derivative 1 linear
fem update nodes derivative 2 linear
fem update nodes derivative 3 linear

fem update field from geometry

fem def data;r;${lobe};example 
fem export data;${lobe} as ${lobe} offset ${off_data}; 

#fem def xi;c closest_face external
#fem def xi;w;${lobe}_0 closest_face external
fem def xi;r;${lobe}_0;example closest_face external
fem li data error

for ($fit_itt=1; $fit_itt<=$tot_itt; $fit_itt=$fit_itt+1)
   fem def fit;r;${lobe}_${fit_itt};example geometry
   fem fit
   fem update node fit
   fem update scale_factor normalise
#   fem def xi;c closest_face external old
#   fem def xi;w;${lobe}_${fit_itt} closest_face external
   fem def xi;r;${lobe}_${fit_itt};example closest_face external   

   system "echo ' ======================================================' "    
   fem li data error
   system "echo ' ITERATION ${fit_itt} DONE' "
   system "echo ' ======================================================' "

fem def nodes;w;${lobe}_fitted
fem def elem;w;${lobe}_fitted
fem export nodes;${lobe}_fitted as ${lobe}_fitted offset ${off}
fem export elem;${lobe}_fitted as ${lobe}_fitted offset_node ${off} offset_elem ${off}

Additional testing commands:

fem list nodes

Files used by this example are:

Name                        Modified     Size

example_971.com 12-Nov-2002 1.4k all_lobe.ipcoor 12-Nov-2002 570 all_lobe.ippara 12-Nov-2002 5.9k all_lobe_cubic.ipbase 12-Nov-2002 4.4k left_lower.com 12-Nov-2002 1.4k left_lower.exdata 12-Nov-2002 103k left_lower.ipcoor 12-Nov-2002 684 left_lower.ipdata 12-Nov-2002 127k left_lower.ipelem 12-Nov-2002 14k left_lower.ipnode 12-Nov-2002 28k left_lower.ippara 12-Nov-2002 5.9k left_lower_0.ipxi 12-Nov-2002 162k left_lower_1.ipfit 13-Apr-2007 7.9k left_lower_1.ipxi 12-Nov-2002 162k left_lower_2.ipfit 13-Apr-2007 7.9k left_lower_2.ipxi 12-Nov-2002 162k left_lower_fitted.exelem 12-Nov-2002 93k left_lower_fitted.exnode 12-Nov-2002 102k left_lower_fitted.ipelem 12-Nov-2002 14k left_lower_fitted.ipnode 12-Nov-2002 158k left_lower_linear.exelem 12-Nov-2002 35k left_lower_linear.exnode 12-Nov-2002 9.1k left_upper.exdata 12-Nov-2002 127k left_upper.ipdata 12-Nov-2002 158k left_upper.ipelem 12-Nov-2002 13k left_upper.ipnode 12-Nov-2002 22k left_upper_0.ipxi 12-Nov-2002 200k left_upper_1.ipfit 13-Apr-2007 2.1k left_upper_1.ipxi 12-Nov-2002 200k left_upper_2.ipfit 13-Apr-2007 2.1k left_upper_2.ipxi 12-Nov-2002 200k left_upper_3.ipfit 13-Apr-2007 2.1k left_upper_3.ipxi 12-Nov-2002 200k left_upper_4.ipfit 13-Apr-2007 2.1k left_upper_4.ipxi 12-Nov-2002 200k left_upper_5.ipfit 13-Apr-2007 2.1k left_upper_fitted.exelem 12-Nov-2002 98k left_upper_fitted.exnode 12-Nov-2002 121k left_upper_fitted.ipelem 12-Nov-2002 13k left_upper_fitted.ipnode 12-Nov-2002 181k left_upper_linear.exelem 12-Nov-2002 38k left_upper_linear.exnode 12-Nov-2002 10k right_lower.com 12-Nov-2002 1.5k right_lower.exdata 12-Nov-2002 91k right_lower.ipdata 12-Nov-2002 114k right_lower.ipelem 12-Nov-2002 10k right_lower.ipnode 12-Nov-2002 14k right_lower_0.ipxi 12-Nov-2002 143k right_lower_1.ipfit 13-Apr-2007 3.4k right_lower_1.ipxi 12-Nov-2002 143k right_lower_2.ipfit 13-Apr-2007 3.4k right_lower_2.ipxi 12-Nov-2002 143k right_lower_3.ipfit 13-Apr-2007 3.4k right_lower_3.ipxi 12-Nov-2002 143k right_lower_fitted.exelem 12-Nov-2002 80k right_lower_fitted.exnode 12-Nov-2002 99k right_lower_fitted.ipelem 12-Nov-2002 11k right_lower_fitted.ipnode 12-Nov-2002 148k right_lower_linear.exelem 12-Nov-2002 31k right_lower_linear.exnode 12-Nov-2002 8.5k right_middle.com 12-Nov-2002 1.5k right_middle.exdata 12-Nov-2002 63k right_middle.ipdata 12-Nov-2002 79k right_middle.ipelem 12-Nov-2002 6.8k right_middle.ipnode 12-Nov-2002 12k right_middle_0.ipxi 12-Nov-2002 99k right_middle_1.ipfit 13-Apr-2007 3.4k right_middle_1.ipxi 12-Nov-2002 99k right_middle_2.ipfit 13-Apr-2007 3.4k right_middle_2.ipxi 12-Nov-2002 99k right_middle_fitted.exelem 12-Nov-2002 53k right_middle_fitted.exnode 12-Nov-2002 66k right_middle_fitted.ipelem 12-Nov-2002 7.0k right_middle_fitted.ipnode 12-Nov-2002 99k right_middle_linear.exelem 12-Nov-2002 20k right_middle_linear.exnode 12-Nov-2002 5.7k right_upper.com 12-Nov-2002 1.5k right_upper.exdata 12-Nov-2002 97k right_upper.ipdata 12-Nov-2002 122k right_upper.ipelem 12-Nov-2002 10k right_upper.ipnode 12-Nov-2002 18k right_upper_0.ipxi 12-Nov-2002 153k right_upper_1.ipfit 13-Apr-2007 6.6k right_upper_1.ipxi 12-Nov-2002 153k right_upper_2.ipfit 13-Apr-2007 8.3k right_upper_2.ipxi 12-Nov-2002 153k right_upper_3.ipfit 13-Apr-2007 8.3k right_upper_3.ipxi 12-Nov-2002 153k right_upper_fitted.exelem 12-Nov-2002 80k right_upper_fitted.exnode 12-Nov-2002 99k right_upper_fitted.ipelem 12-Nov-2002 11k right_upper_fitted.ipnode 12-Nov-2002 148k right_upper_linear.exelem 12-Nov-2002 31k right_upper_linear.exnode 12-Nov-2002 8.5k test_output.com 12-Nov-2002 15

Download the entire example:

Name                      Modified     Size

examples_9_97_971.tar.gz 14-Apr-2007 1.4M

Testing status by version:

StatusTestedReal time (s)
hpc_cm64_irixSuccessThu Apr 1 10:53:44 2004121
hpc_cm_irixSuccessFri Jul 29 01:32:43 2005101
hpc_cmo64_irixSuccessThu Apr 1 10:52:22 200438
hpc_cmo_irixSuccessSun Jul 31 01:38:26 200532
cmSuccessWed Mar 4 01:13:27 20099
cm-debugSuccessMon Mar 2 01:23:24 200956
cm64SuccessWed Mar 4 01:13:31 20099
cm64-debugSuccessTue Mar 3 01:25:36 200955
cmSuccessSun Mar 6 00:01:16 20164
cm-debugSuccessSat Mar 5 00:03:37 201612

Testing status by file:

Html last generated: Sun Mar 6 05:50:35 2016

Input last modified: Fri Apr 13 10:37:20 2007

CMISS Help / Examples / 9 / 97 / 971