0
|
1 /**
|
|
2 * Palantir - A Lightweight, RESTful DICOM Store
|
|
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
|
|
23 #include "../PalantirException.h"
|
|
24
|
|
25 #include <iostream>
|
|
26 #include <iomanip>
|
|
27
|
|
28 namespace Palantir
|
|
29 {
|
|
30 bool DicomTag::operator< (const DicomTag& other) const
|
|
31 {
|
|
32 if (group_ < other.group_)
|
|
33 return true;
|
|
34
|
|
35 if (group_ > other.group_)
|
|
36 return false;
|
|
37
|
|
38 return element_ < other.element_;
|
|
39 }
|
|
40
|
|
41
|
|
42 std::ostream& operator<< (std::ostream& o, const DicomTag& tag)
|
|
43 {
|
|
44 using namespace std;
|
|
45 ios_base::fmtflags state = o.flags();
|
|
46 o.flags(ios::right | ios::hex);
|
|
47 o << "(" << setfill('0') << setw(4) << tag.GetGroup()
|
|
48 << "," << setw(4) << tag.GetElement() << ")";
|
|
49 o.flags(state);
|
|
50 return o;
|
|
51 }
|
|
52
|
|
53
|
|
54 const DicomTag DicomTag::ACCESSION_NUMBER = DicomTag(0x0008, 0x0050);
|
|
55 const DicomTag DicomTag::IMAGE_INDEX = DicomTag(0x0054, 0x1330);
|
|
56 const DicomTag DicomTag::INSTANCE_UID = DicomTag(0x0008, 0x0018);
|
|
57 const DicomTag DicomTag::NUMBER_OF_SLICES = DicomTag(0x0054, 0x0081);
|
|
58 const DicomTag DicomTag::PATIENT_ID = DicomTag(0x0010, 0x0020);
|
|
59 const DicomTag DicomTag::SERIES_UID = DicomTag(0x0020, 0x000e);
|
|
60 const DicomTag DicomTag::STUDY_UID = DicomTag(0x0020, 0x000d);
|
|
61 const DicomTag DicomTag::PIXEL_DATA = DicomTag(0x7fe0, 0x0010);
|
|
62 }
|