Example 61: Using XVG


The comfile run by this example is as follows:

#Example_61 Setting the imaging environment                                                                                         
                                                                                                                                    
#  NOTE: The image is only visible on a 256 colour workstation                                                                      
                                                                                                                                    
fem                          #set the FEM environment                                                                               
fem define image;r;hip_example;example                                                                                                  
#                           !reads a binary format image file of size 512 x                                                         
#                            512 pixels                                                                                             
fem draw image              #displays the image in the first window. The                                                            
#                            default resolution is 256 x 256                                                                        
fem change LUT start black end white                                                                                                
#                           !this command changes the colour look up table                                                          
#                            with colours evenly graduated between the start and end colours.  Other                                
#                            possible colours include red, yellow, blue, green, etc.                                                
fem change LUT default       #returns the colours to their original values.                                                         
#                            Choose Display... from the menu then Profile                                                           
#                            Image form the second menu. Select                                                                     
#                            Polyline_locate and click two ends of a line                                                           
#                            over some region of interest (middle button to                                                         
#                            finish.)  Choose exit to see the image profile.                                                        
#                            Choose Label then Segment Remove from the menu                                                         
#                            that appears.  Pick the line just created                                                              
#                            using the LH mouse button, then the middle                                                             
#                            button to finish. Choose exit from the second                                                          
#                            menu then exit from the first menu to return                                                           
#                            to the command line.                                                                                   
fem draw image resolution 64                                                                                                        
#                           !displays the image in a lower resolution for                                                           
#                            speed of display                                                                                       
fem define node;m            #select two nodes on either side of the image                                                          
#                            near the bottom, a third on the edge of the                                                            
#                            red (high density) area above node 1, a fourth                                                         
#                            above the second node on the edge of the red                                                           
#                            ares and the fifth and sixth to the top-left                                                           
#                            of the red area, as indicated in the manual.                                                           
#                            Click the centre button to finish.                                                                     
fem define basis;p           #enter one Lagrange/Tensor prod basis function                                                         
#                            with two Xi coordinates, with a Linear                                                                 
#                            Lagrange interpolation and seven gauss points                                                          
#                            in each direction.  Use the default settings                                                           
#                            for the remainder of the questions.                                                                    
fem hide image               #to improve the response time                                                                          
fem define element;m         #click on the nodes in the following order:                                                            
#                            1,2,3,4 then 3,4,5,6 and the centre button to                                                          
#                            finish.                                                                                                
fem show image               #redisplays the image on the screen                                                                    
fem draw line rgb=blue       #redisplays the mesh over the image                                                                    
fem draw gauss rgb=black     #shows th edistribution fo the gauss (density                                                          
#                            sampling) points                                                                                       
fem define gauss;c average 3 #this averages three pixels of data around each                                                        
#                            gauss point and stores these averages.  This                                                           
#                            is the command that extracts the information                                                           
#                            from the in=mage for use by CMISS                                                                      
fem define field;p           #enter one variable, then d to use default                                                             
#                            settings for the remaining questions                                                                   
fem define fit;d gauss       #set the fitting algorithm to use data from the                                                        
#                            gauss points                                                                                           
fem fit gauss                #fits a field to the data extracted at the                                                             
#                            gauss points                                                                                           
fem draw field               #displays the field over the image                                                                     
fem quit                     #exit form CMISS                                                                                       

Files used by this example are:

Name            Modified     Size

example_61.com 10-Apr-2000 7.9k

Download the entire example:

Name                  Modified     Size

examples_6_61.tar.gz 19-Aug-2006 2.2k

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

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


CMISS Help / Examples / 6 / 61