~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Linux Cross Reference
Tina4/src/file/ani/write_air16.c

Version: ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* Copyright 1995 Roger P. Woods, M.D. */
  2 /* Modified 12/16/95 */
  3 
  4 /*
  5  * int write_air16()
  6  *
  7  * writes an AIR reslice parameter file
  8  * adjusts e matrix to cubic voxel default when zooming==0
  9  * assumes adjustment has already been made when zooming!=0
 10  *
 11  * returns:
 12  *      1 if successful
 13  *      0 if unsuccessful
 14  */
 15 
 16 #include <tina/sys.h>
 17 #include <tina/sysfuncs.h>
 18 #include "AIR.h"
 19 
 20 int write_air16(char *outputfile,int permission, struct air16 *air1)
 21 {
 22         FILE            *fp;
 23         int             i,j;
 24         char            filename[128];
 25         double          pixel_size_s;
 26 
 27         strcpy(filename,outputfile);
 28 
 29 
 30         /*Open output file if permitted to do so*/
 31         if(!permission){
 32             if((fp=fopen(filename,"rb"))!=NULL){
 33                 fclose(fp);
 34                     format("file %s exists, no permission to overwrite\n",filename);
 35             }
 36 /*
 37             fclose(fp);
 38 */
 39         }
 40         if((fp=fopen(filename,"wb"))==NULL){
 41             format("cannot open file %s for output\n",filename);
 42             return 0;
 43         }
 44  
 45         /*Write out air struct*/
 46         if(fwrite((char *)air1,1,sizeof(struct air16),fp)!=sizeof(struct air16)){
 47                 format("file write error for file %s\n",filename);
 48                 fclose(fp);
 49                 return 0;
 50         }
 51         fclose(fp);
 52 
 53         return 1;
 54 }
 55 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.