Mercurial > hg > orthanc
annotate Core/DicomFormat/DicomTag.cpp @ 61:d1c511efd6b1 orthanc-renaming
renaming of explorer
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Sun, 16 Sep 2012 09:30:31 +0200 |
parents | c996319e90bc |
children | b8dfde8d64e8 |
rev | line source |
---|---|
0 | 1 /** |
59 | 2 * Orthanc - A Lightweight, RESTful DICOM Store |
0 | 3 * Copyright (C) 2012 Medical Physics Department, CHU of Liege, |
4 * Belgium | |
5 * | |
6 * This program is free software: you can redistribute it and/or | |
7 * modify it under the terms of the GNU General Public License as | |
8 * published by the Free Software Foundation, either version 3 of the | |
9 * License, or (at your option) any later version. | |
10 * | |
11 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. | |
18 **/ | |
19 | |
20 | |
21 #include "DicomTag.h" | |
22 | |
59 | 23 #include "../OrthancException.h" |
0 | 24 |
25 #include <iostream> | |
26 #include <iomanip> | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
27 #include <stdio.h> |
0 | 28 |
59 | 29 namespace Orthanc |
0 | 30 { |
31 bool DicomTag::operator< (const DicomTag& other) const | |
32 { | |
33 if (group_ < other.group_) | |
34 return true; | |
35 | |
36 if (group_ > other.group_) | |
37 return false; | |
38 | |
39 return element_ < other.element_; | |
40 } | |
41 | |
42 | |
43 std::ostream& operator<< (std::ostream& o, const DicomTag& tag) | |
44 { | |
45 using namespace std; | |
46 ios_base::fmtflags state = o.flags(); | |
47 o.flags(ios::right | ios::hex); | |
48 o << "(" << setfill('0') << setw(4) << tag.GetGroup() | |
49 << "," << setw(4) << tag.GetElement() << ")"; | |
50 o.flags(state); | |
51 return o; | |
52 } | |
53 | |
54 | |
35
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
55 std::string DicomTag::Format() const |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
56 { |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
57 char b[16]; |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
58 sprintf(b, "%04x,%04x", group_, element_); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
59 return std::string(b); |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
60 } |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
61 |
f6d12037f886
full json vs. simplified json
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
0
diff
changeset
|
62 |
0 | 63 const DicomTag DicomTag::ACCESSION_NUMBER = DicomTag(0x0008, 0x0050); |
64 const DicomTag DicomTag::IMAGE_INDEX = DicomTag(0x0054, 0x1330); | |
65 const DicomTag DicomTag::INSTANCE_UID = DicomTag(0x0008, 0x0018); | |
66 const DicomTag DicomTag::NUMBER_OF_SLICES = DicomTag(0x0054, 0x0081); | |
67 const DicomTag DicomTag::PATIENT_ID = DicomTag(0x0010, 0x0020); | |
68 const DicomTag DicomTag::SERIES_UID = DicomTag(0x0020, 0x000e); | |
69 const DicomTag DicomTag::STUDY_UID = DicomTag(0x0020, 0x000d); | |
70 const DicomTag DicomTag::PIXEL_DATA = DicomTag(0x7fe0, 0x0010); | |
71 } |