Doxygen Source Code Documentation
        
Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search   
mri_float_func.c
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 #include "mrilib.h"
00008 
00009 
00010 
00011 
00012 
00013 MRI_IMAGE * mri_float_func( int   nx    , int   ny ,
00014                             float xzero , float yzero ,
00015                             float dx    , float dy ,
00016                             float (* func)( float , float ) )
00017 {
00018    int ii , jj , jpos ;
00019    float yy ;
00020    MRI_IMAGE * im ;
00021    float *     flim ;
00022 
00023    im   = mri_new( nx ,ny , MRI_float ) ;
00024    flim = mri_data_pointer( im ) ;
00025 
00026    for( jj=0 ; jj < ny ; jj++ ){
00027       jpos = nx * jj ;
00028       yy   = yzero + jj * dy ;
00029       for( ii=0 ; ii < nx ; ii++ ){
00030          flim[ii+jpos] = func( xzero + ii*dx , yy ) ;
00031       }
00032    }
00033 
00034    return im ;
00035 }