dicom2dump.cc 918 Bytes
Newer Older
1
#include <mln/core/concept/image.hh>
2
#include <mln/core/image/image2d.hh>
3
4
#include <mln/core/image/image3d.hh>

Fabien Freling's avatar
Fabien Freling committed
5
#include <mln/value/int_u8.hh>
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include <mln/value/int_u12.hh>
#include <mln/io/dicom/load.hh>
#include <mln/io/dump/save.hh>



int usage(char* argv[])
{
  std::cerr << "usage: " << argv[0] << " input.dcm output.dump" << std::endl;
  std::cerr << "\t work for 3D images encoded in int_u12" << std::endl;
  return 1;
}


20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*int main(int argc, char* argv[])
{
  using namespace mln;
  using value::int_u12;

  if (argc != 3)
    return usage(argv);

  image3d<int_u12> ima;
  io::dicom::load(ima, argv[1]);
  io::dump::save(ima, argv[2]);

  return 0;
}*/
34
35
36
37

int main(int argc, char* argv[])
{
  using namespace mln;
Fabien Freling's avatar
Fabien Freling committed
38
  using value::int_u8;
39
40
41
42
43
  using value::int_u12;

  if (argc != 3)
    return usage(argv);

Fabien Freling's avatar
Fabien Freling committed
44
  image2d<int_u8> ima;
45
46
47
48
49
  io::dicom::load(ima, argv[1]);
  io::dump::save(ima, argv[2]);

  return 0;
}