Example 2174: Use of snake algorithm on angio data


The comfile run by this example is as follows:

#Example_2174  Quantitative coronary angiography.                                                                                   
                                                                                                                                    
#This is an example of imaging commands                                                                                             
#which can be used to detect the boundaries of blood vessels in a greyscale                                                         
#image. The user defines the centreline of the vessel segment of interest by                                                        
#manipulating Bezier control points. The algorithm uses "snakes", an energy                                                         
#minimising spline, to find the boundaries. For more information on the                                                             
#ANGIO environment, see Peter's ANGIO directory.                                                                                    
                                                                                                                                    
imp set graphics on              #to draw graphics on image                                                                         
fem def coo;r;snake              #2D rectangular cartesian                                                                          
fem def bas;r;snake              #1D cubic Hermite elements                                                                         
fem def wind;r;snake             #512x512 pixel coordinates                                                                         
#imp define transformation;r;pg1q geom number 1 model 9 !pincushion                                                                 
#imp list trans;geom number 1                           !check                                                                      
assign;p "FILE"                  #data file                                                                                         
fem def nod;m on 5               #define two or more element endpoints                                                              
fem change nod;m on 5            #change if necessary                                                                               
fem def ele;c with 1,1,1         #define elements                                                                                   
fem def li;c                                                                                                                        
fem draw li on 1,5              #draw elements                                                                                      
fem change line;m on 5           #change slopes                                                                                     
fem def nod;w;FILE                                                                                                                  
fem def ele;w;FILE                                                                                                                  
fem def data;c cat step 4        #creates data array at intervals of 4 units                                                        
fem draw data on 1                                                                                                                  
fem def data;w;FILE                                                                                                                 
imp def data;r;FILE              #reads data into imp environment                                                                   
imp set window;c                 #calculates window of interest                                                                     
imp set i2p1 buf0                #copies window from frame buffer to int array                                                      
imp lesion i2p1 params 0.0,50.0,50.0 weights 1,2.426    #finds boundaries                                                           
imp set i2p1 buf0                #copies window from frame buffer to int array                                                      
imp set graphics off             #to re-enable frame grabbing                                                                       
fem quit                                                                                                                            

Files used by this example are:

Name              Modified     Size

example_2174.com 10-Apr-2000 4.4k

Download the entire example:

Name                           Modified     Size

examples_2_21_217_2174.tar.gz 19-Aug-2006 1.6k

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

Input last modified: Mon Apr 10 17:21:25 2000


CMISS Help / Examples / 2 / 21 / 217 / 2174