comparison Framework/DicomToolbox.h @ 0:4a7a53257c7d

initial commit
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 22 Oct 2016 21:48:33 +0200
parents
children f45cec2c32e2
comparison
equal deleted inserted replaced
-1:000000000000 0:4a7a53257c7d
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 *
6 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Affero General Public License
8 * as published by the Free Software Foundation, either version 3 of
9 * the 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 * Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 **/
19
20
21 #pragma once
22
23 #if ORTHANC_ENABLE_DCMTK == 1
24 # include <dcmtk/dcmdata/dcdeftag.h>
25 # include <dcmtk/dcmdata/dcitem.h>
26 # include <dcmtk/dcmdata/dctagkey.h>
27 #endif
28
29 #include <string>
30 #include <stdint.h>
31 #include <json/value.h>
32
33 namespace OrthancWSI
34 {
35 namespace DicomToolbox
36 {
37 #if ORTHANC_ENABLE_DCMTK == 1
38 void SetStringTag(DcmItem& dataset,
39 const DcmTagKey& key,
40 const std::string& value);
41
42 void SetUint16Tag(DcmItem& dataset,
43 const DcmTagKey& key,
44 uint16_t value);
45
46 void SetUint32Tag(DcmItem& dataset,
47 const DcmTagKey& key,
48 uint32_t value);
49
50 DcmItem* ExtractSingleSequenceItem(DcmItem& dataset,
51 const DcmTagKey& key);
52
53 uint16_t GetUint16Tag(DcmItem& dataset,
54 const DcmTagKey& key);
55
56 uint32_t GetUint32Tag(DcmItem& dataset,
57 const DcmTagKey& key);
58
59 int32_t GetInt32Tag(DcmItem& dataset,
60 const DcmTagKey& key);
61
62 std::string GetStringTag(DcmItem& dataset,
63 const DcmTagKey& key);
64 #endif
65
66 bool GetStringTag(std::string& result,
67 const Json::Value& simplifiedTags,
68 const std::string& tagName,
69 const std::string& defaultValue);
70
71 std::string GetMandatoryStringTag(const Json::Value& simplifiedTags,
72 const std::string& tagName);
73
74 const Json::Value& GetSequenceTag(const Json::Value& simplifiedTags,
75 const std::string& tagName);
76
77 int GetIntegerTag(const Json::Value& simplifiedTags,
78 const std::string& tagName);
79
80 unsigned int GetUnsignedIntegerTag(const Json::Value& simplifiedTags,
81 const std::string& tagName);
82 }
83 }