Doxygen Source Code Documentation
Main Page Alphabetical List Data Structures File List Data Fields Globals Search
3dinfo.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007 #include "mrilib.h"
00008
00009 void Syntax(void)
00010 {
00011 printf(
00012 "Prints out sort-of-useful information from a 3D dataset's header\n"
00013 "Usage: 3dinfo [-verb OR -short] dataset [dataset ...]\n"
00014 " -verb means to print out lots of stuff\n"
00015 " -short means to print out less stuff\n"
00016 ) ;
00017 exit(0) ;
00018 }
00019
00020 int main( int argc , char * argv[] )
00021 {
00022 THD_3dim_dataset * dset ;
00023 int iarg , verbose = 0 ;
00024 char * outbuf ;
00025
00026 if( argc < 2 || strncmp(argv[1],"-help",4) == 0 ) Syntax() ;
00027
00028 mainENTRY("3dinfo main") ; machdep() ; PRINT_VERSION("3dinfo") ;
00029
00030 iarg = 1 ;
00031 if( strncmp(argv[iarg],"-verb" ,5) == 0 ){ verbose = 1; iarg++; }
00032 else if( strncmp(argv[iarg],"-short",5) == 0 ){ verbose = -1; iarg++; }
00033
00034 for( ; iarg < argc ; iarg++ ){
00035 #if 0
00036 dset = THD_open_one_dataset( argv[iarg] ) ;
00037 #else
00038 dset = THD_open_dataset( argv[iarg] ) ;
00039 #endif
00040 if( dset == NULL ){
00041 printf("\nCan't open dataset %s\n",argv[iarg]) ;
00042 continue ;
00043 }
00044
00045 outbuf = THD_dataset_info( dset , verbose ) ;
00046 if( outbuf != NULL ){
00047 printf("\n") ;
00048 puts(outbuf) ;
00049 free(outbuf) ; outbuf = NULL ;
00050 } else {
00051 printf("\nCan't get info for dataset %s\n",argv[iarg]) ;
00052 }
00053
00054 THD_delete_3dim_dataset( dset , False ) ;
00055 }
00056 exit(0) ;
00057 }