~ubuntu-branches/ubuntu/raring/voxbo/raring

« back to all changes in this revision

Viewing changes to fileformats/dicominfo.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2010-06-06 11:33:11 UTC
  • Revision ID: james.westby@ubuntu.com-20100606113311-v3c13imdkkd5n7ae
Tags: upstream-1.8.5~svn1172
ImportĀ upstreamĀ versionĀ 1.8.5~svn1172

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// dicominfo.cpp
 
3
// dump DICOM headers
 
4
// Copyright (c) 1998-2006 by The VoxBo Development Team
 
5
 
 
6
// VoxBo is free software: you can redistribute it and/or modify it
 
7
// under the terms of the GNU General Public License as published by
 
8
// the Free Software Foundation, either version 3 of the License, or
 
9
// (at your option) any later version.
 
10
// 
 
11
// VoxBo is distributed in the hope that it will be useful, but
 
12
// WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
14
// General Public License for more details.
 
15
// 
 
16
// You should have received a copy of the GNU General Public License
 
17
// along with VoxBo.  If not, see <http://www.gnu.org/licenses/>.
 
18
// 
 
19
// For general information on VoxBo, including the latest complete
 
20
// source code and binary distributions, manual, and associated files,
 
21
// see the VoxBo home page at: http://www.voxbo.org/
 
22
//
 
23
// original version written by Dan Kimberg
 
24
 
 
25
using namespace std;
 
26
 
 
27
#include <stdio.h>
 
28
#include <sys/types.h>
 
29
#include <sys/stat.h>
 
30
#include <dirent.h>
 
31
#include <errno.h>
 
32
#include <stdlib.h>
 
33
#include <unistd.h>
 
34
#include <ctype.h>
 
35
#include <sstream>
 
36
#include "vbutil.h"
 
37
#include "vbio.h"
 
38
 
 
39
extern "C" {
 
40
 
 
41
 
 
42
#include "dicom.h"
 
43
void dicominfo_help();
 
44
void dicominfo_version();
 
45
 
 
46
int
 
47
main(int argc,char **argv)
 
48
{
 
49
  tokenlist args;
 
50
  args.Transfer(argc-1,argv+1);
 
51
  if (args.size()==0) {
 
52
    dicominfo_help();
 
53
    exit(0);
 
54
  }
 
55
  if (args[0]=="-h") {
 
56
    dicominfo_help();
 
57
    exit(0);
 
58
  }
 
59
  if (args[0]=="-v") {
 
60
    dicominfo_version();
 
61
    exit(0);
 
62
  }
 
63
 
 
64
  // dicominfo dci;
 
65
  for (int i=0; i<args.size(); i++)
 
66
    print_dicom_header(args[i]);
 
67
  exit(0);
 
68
}
 
69
 
 
70
 
 
71
void
 
72
dicominfo_help()
 
73
{
 
74
  printf("\nVoxBo dicominfo (v%s)\n",vbversion.c_str());
 
75
  printf("summary:\n");
 
76
  printf("  dump raw dicom fields in human-readable form\n");
 
77
  printf("usage:\n");
 
78
  printf("  dicominfo  <file>\n");
 
79
  printf("\n");
 
80
}
 
81
 
 
82
void
 
83
dicominfo_version()
 
84
{
 
85
  printf("VoxBo dicominfo (v%s)\n",vbversion.c_str());
 
86
}
 
87
 
 
88
 
 
89
 
 
90
 
 
91
 
 
92
}