]> Creatis software - clitk.git/blob - tools/clitkImageInfo.cxx
removed headers
[clitk.git] / tools / clitkImageInfo.cxx
1 /**
2    =================================================
3    * @file   clitkImageInfo.cxx
4    * @author David Sarrut <david.sarrut@creatis.insa-lyon.fr>
5    * @date   02 Jul 2006
6    =================================================*/
7
8 // itk include
9 #include "itkImageIOBase.h"
10
11 // clitk include
12 #include "clitkImageInfo_ggo.h"
13 #include "clitkIO.h"
14 #include "clitkImageCommon.h"
15
16 //====================================================================
17 int main(int argc, char * argv[]) {
18
19   // init command line
20   GGO(clitkImageInfo, args_info);
21   CLITK_INIT;
22
23   // check arg
24   if (args_info.inputs_num == 0) return 0;
25
26   // read Header 
27   for(unsigned int i=0; i<args_info.inputs_num; i++) {
28     itk::ImageIOBase::Pointer header = clitk::readImageHeader(args_info.inputs[i]);
29     if (header) {
30       if (args_info.name_flag) std::cout << "[" << args_info.inputs[i] << "]\t ";
31       if (args_info.long_given) {
32         //      std::cout << std::endl;
33         clitk::printImageHeader(header, std::cout, args_info.long_arg);
34       }
35       else {
36         if (args_info.verbose_flag) clitk::printImageHeader(header, std::cout, 1);
37         else {
38           clitk::printImageHeader(header, std::cout, 0);
39           std::cout << std::endl;
40         }
41       }
42     }  // heade null ; non fatal error
43       else {
44         std::cerr << "*** Warning : I could not read '" << args_info.inputs[i] << "' ***" << std::endl;
45       }
46   }
47
48   // this is the end my friend  
49   return 0;
50 }
51 //====================================================================