Example e53: Ultrasound contour tracing

Viewing experimentally obtained 3D ultrasound images and borders which were traced around them. Three heart surfaces (epicardial, left and right ventricles) have also been fitted to the data.

The right ventricle is shown in blue and the left ventricle in green and the epicardial data in red.

Shown below (from left to right) are a standard 2D ultrasound, a long axis view of the model and a short axis view of the model.

2DUltrasound LongAxis ShortAxis
Note: this example requires 80Mb of memory and the movie will play slowly over a network


The comfile run by this example is as follows:

# Set the default tessellation to use 4 segments in each element direction.
# This command does not exist on older versions of cmgui. It is safe to ignore errors.
gfx define tessellation default minimum_divisions 4 refinement_factors 1;

#
# Load in subroutines from other files
#
open com example loop_squares.com exec 1
open com example loop_cone.com exec 1
open com example draw_cones.com exec 1

#
# Create some materials
#
gfx create material dred     diffuse 1.0 0.0 0.0 specular 0.6 0.3 0.3 shininess 1.0
gfx create material dblue    diffuse 0.0 0.1 1.0 specular 0.4 0.4 0.5 shininess 0.5 
gfx create material dgreen   diffuse 0.0 0.5 0.0 specular 0.4 0.4 0.5 shininess 0.5 
gfx create material beige    diffuse 1.0 0.8 0.7 specular 1.0 0.6 0.6 shininess 1.0
gfx create material ghost    diffuse 0.6 0.6 0.6 alpha 0.16 
gfx create material dgrey    diffuse 0.2 0.2 0.2 


#
# Read in the meshes and the data
#
gfx read node example epi
gfx read elem example epi
gfx read data example epi
gfx modify g_elem epi line coordinate coordinates material dgrey invis
gfx modify g_elem epi surf coordinate coordinates material dred invis
gfx modify g_elem epi data coordinate data_coordinate material dred glyph cross size 1


gfx read node example lvendo
gfx read elem example lvendo
gfx read data example lvendo
gfx modify g_elem lvendo line coordinate coordinates material dgrey
gfx modify g_elem lvendo surf coordinate coordinates material dgreen
gfx modify g_elem lvendo data coordinate data_coordinate material dgreen glyph cross size 1

gfx read node example rvendo
gfx read elem example rvendo
gfx read data example rvendo
gfx modify g_elem rvendo line coordinate coordinates material dgrey
gfx modify g_elem rvendo surf coordinate coordinates material dblue
gfx modify g_elem rvendo data coordinate data_coordinate material dblue glyph cross size 1



#
# Open window 1 with appropriate view
#
gfx create window 1
gfx modify window 1 image view
gfx modify window 1 set slow
gfx modify window 1 set pert
gfx modify window 1 background colour 0 0 0 all




loop_squares("s01f033", 51000);

loop_squares("s02f135", 52000);

loop_squares("s05f008", 55000);

loop_squares("s06f148", 56000);


#
# Masks the other cones ...
#
draw_cones();

# hide graphics for one of the squares
#gfx set visibility "/" name s01f033 off;
gfx set visibility "/" name s05f008 off;
# old command:
#gfx set visibility s05f008;


#
# Test by exporting to vrml amd write texture
#
gfx export vrml file ultrasound_cones
gfx write tex tex_s06f148 file texture_alpha.rgb rgb





Files used by this example are:

Name              Modified     Size

example_e53.com 27-Jan-2012 2.5k draw_cones.com 22-Mar-2002 786 epi.exdata 02-Feb-2011 90k epi.exelem 20-Nov-2001 47k epi.exnode 20-Nov-2001 39k loop_cone.com 27-Jan-2012 1.1k loop_squares.com 27-Jan-2012 976 lvendo.exdata 02-Feb-2011 92k lvendo.exelem 20-Nov-2001 47k lvendo.exnode 20-Nov-2001 39k rboyes2s02.mov 20-Nov-2001 1.3M rvendo.exdata 02-Feb-2011 33k rvendo.exelem 20-Nov-2001 28k rvendo.exnode 20-Nov-2001 24k s01f033.exelem 20-Nov-2001 1.8k s01f033.exnode 20-Nov-2001 459 s01f033.rgb 20-Nov-2001 400k s02f135.exelem 20-Nov-2001 1.8k s02f135.exnode 20-Nov-2001 461 s02f135.rgb 20-Nov-2001 405k s05f008.exelem 20-Nov-2001 1.8k s05f008.exnode 20-Nov-2001 460 s05f008.rgb 20-Nov-2001 407k s06f148.exelem 20-Nov-2001 1.8k s06f148.exnode 20-Nov-2001 457 s06f148.rgb 20-Nov-2001 401k startmovie.com 20-Nov-2001 256 stencil.rgb 20-Nov-2001 16k

Download the entire example:

Name                      Modified     Size

examples_e_e5_e53.tar.gz 28-Jan-2012 2.6M

Testing status by version:

StatusTestedReal time (s)
i686-linux
cmgui-wxSuccessSun Mar 6 00:21:11 20165
cmgui-wx-debugSuccessSun Mar 6 00:23:51 20166
cmgui-wx-debug-memorycheckSuccessSun Mar 6 00:21:17 20167
cmgui-wx-debug-valgrindFailureSun Mar 6 01:53:12 2016228
last breakSun Mar 6 01:49:00 2016228
last successTue Feb 10 02:03:00 2015235
x86_64-linux
cmgui-wxFailureSun Mar 6 00:01:38 20160
last breakSun Mar 6 00:01:00 20160
last successWed Jun 3 00:06:00 20152
cmgui-wx-debugFailureSun Mar 6 00:01:38 20160
last breakSun Mar 6 00:01:00 20160
last successWed Jun 3 00:07:00 20153
cmgui-wx-debug-memorycheckFailureSun Mar 6 00:01:38 20160
last breakSun Mar 6 00:01:00 20160
last successWed Jun 3 00:07:00 20154
cmgui-wx-debug-valgrindFailureSun Mar 6 00:03:23 20169
last breakSun Mar 6 00:03:00 20169
last successWed Jun 3 01:08:00 2015163
cmgui-wx-gcc-cad-debugSuccessTue May 24 00:37:17 201190
cmgui-wx-gcc-cad-debug-valgrindSuccessThu Jan 7 00:02:18 20166

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: Fri Jan 27 14:15:53 2012


CMISS Help / Examples / e / e5 / e53