File: TestElement2.cxx

package info (click to toggle)
gdcm 3.0.24-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,856 kB
  • sloc: cpp: 203,722; ansic: 76,471; xml: 48,131; python: 3,473; cs: 2,308; java: 1,629; lex: 1,290; sh: 334; php: 128; makefile: 97
file content (54 lines) | stat: -rw-r--r-- 1,529 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*=========================================================================

  Program: GDCM (Grassroots DICOM). A DICOM library

  Copyright (c) 2006-2011 Mathieu Malaterre
  All rights reserved.
  See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
#include "gdcmElement.h"
#include "gdcmVR.h"

struct dummy
{
  unsigned short I[3];
};
// <entry group="0018" element="1624" retired="false" version="3">
//      <representation vr="US" vm="3"/>

template<int,int> struct TagToElement;
template<> struct TagToElement<0x0018,0x1624> {
  using Type = gdcm::Element<gdcm::VR::US, gdcm::VM::VM3>;
};

int TestElement2(int, char *[])
{
  gdcm::Element<gdcm::VR::US, gdcm::VM::VM3> ref = {{0,1,2}};
  ref.Print(std::cout);
  //dummy d = {{0,1,2}};//commenting out

  TagToElement<0x0018,0x1624>::Type t = {{1,2,3}};
  t.Print( std::cout );
  std::cout << std::endl;

  gdcm::Element<gdcm::VR::US, gdcm::VM::VM1_2> ref2; // = {{1}};
  ref2.SetLength(2);
  ref2.SetValue(1);
  ref2.Print(std::cout);
  std::cout << std::endl;

  gdcm::Element<gdcm::VR::US, gdcm::VM::VM3_4> ref3; // = {{1}};
  ref3.SetLength(4);
  ref3.SetValue(1,0);
  ref3.SetValue(2,1);
  ref3.Print(std::cout);
  std::cout << std::endl;


  return 0;
}