Doxygen Source Code Documentation
        
Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals   Search   
3dnvals.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 the number of sub-bricks in a 3D dataset\n"
00013     "Usage: 3dnvals [-verb] dataset\n"
00014    ) ;
00015    exit(0) ;
00016 }
00017 
00018 int main( int argc , char * argv[] )
00019 {
00020    THD_3dim_dataset * dset ;
00021    int iarg , verbose = 0 ;
00022 
00023    if( argc < 2 || strncmp(argv[1],"-help",4) == 0 ) Syntax() ;
00024 
00025    iarg = 1 ;
00026    if( strncmp(argv[iarg],"-verb",5) == 0 ){ verbose = 1 ; iarg++ ; }
00027 
00028    for( ; iarg < argc ; iarg++ ){
00029       dset = THD_open_dataset( argv[iarg] ) ;
00030       if( dset == NULL ){
00031          printf("-1\n") ;
00032          continue ;
00033       }
00034       printf("%d\n",DSET_NVALS(dset)) ;
00035 
00036       THD_delete_3dim_dataset( dset , False ) ;
00037    }
00038    exit(0) ;
00039 }