Doxygen Source Code Documentation
        
Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search   
imswap.c
Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006    
00007 #include "mrilib.h"
00008 
00009 int main( int argc , char *argv[] )
00010 {
00011    MRI_IMAGE *im ;
00012 
00013    if( argc < 3 || strncmp(argv[1],"-help",5) == 0 ){
00014       fprintf( stderr , "Usage: imswap infile outfile\n"
00015                         "* Swaps bytes in infile to produce outfile!\n" ) ;
00016       exit(0) ;
00017    }
00018 
00019    machdep() ;
00020 
00021    im = mri_read_just_one( argv[1] ) ;  if( im == NULL ) exit(1) ;
00022    mri_swapbytes( im ) ;
00023    mri_write( argv[2] , im ) ;
00024 
00025    exit(0) ;
00026 }