Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Toolbox/DicomStructuredReport.h @ 2088:b98d159c7545 dicom-sr
created branch dicom-sr
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 07 Nov 2023 18:12:35 +0100 |
parents | 51c8b21b81e4 |
children | 63d77859edee 7c3d65166c26 |
rev | line source |
---|---|
2085
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Stone of Orthanc |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * This program is free software: you can redistribute it and/or |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public License |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * as published by the Free Software Foundation, either version 3 of |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * the License, or (at your option) any later version. |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, but |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
16 * Lesser General Public License for more details. |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
17 * |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
19 * License along with this program. If not, see |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
20 * <http://www.gnu.org/licenses/>. |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 **/ |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
24 #pragma once |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
26 #if !defined(ORTHANC_ENABLE_DCMTK) |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
27 # error The macro ORTHANC_ENABLE_DCMTK must be defined |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
28 #endif |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 #if ORTHANC_ENABLE_DCMTK != 1 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 # error Support for DCMTK must be enabled |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
32 #endif |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
34 #include <DicomParsing/ParsedDicomFile.h> |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
35 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
36 #include <dcmtk/dcmdata/dcitem.h> |
2087 | 37 #include <list> |
2085
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
38 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 namespace OrthancStone |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
40 { |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
41 class DicomStructuredReport : public boost::noncopyable |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
42 { |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
43 private: |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
44 class Structure; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
45 class Point; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
46 class Polyline; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
47 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
48 class ReferencedInstance |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
49 { |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
50 private: |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
51 std::string studyInstanceUid_; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
52 std::string seriesInstanceUid_; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
53 std::string sopClassUid_; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
54 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
55 public: |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
56 ReferencedInstance(const std::string& studyInstanceUid, |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
57 const std::string& seriesInstanceUid, |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
58 const std::string& sopClassUid) : |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
59 studyInstanceUid_(studyInstanceUid), |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
60 seriesInstanceUid_(seriesInstanceUid), |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
61 sopClassUid_(sopClassUid) |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
62 { |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
63 } |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
64 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
65 ReferencedInstance() |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
66 { |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
67 } |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
68 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
69 const std::string& GetStudyInstanceUid() const |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
70 { |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
71 return studyInstanceUid_; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 } |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
74 const std::string& GetSeriesInstanceUid() const |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
75 { |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 return seriesInstanceUid_; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 } |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
78 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
79 const std::string& GetSopClassUid() const |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
80 { |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
81 return sopClassUid_; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
82 } |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
83 }; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
84 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
85 void AddStructure(const std::string& sopInstanceUid, |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
86 DcmItem& group, |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
87 bool hasFrameNumber, |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
88 unsigned int frameNumber, |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
89 bool hasProbabilityOfCancer, |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
90 float probabilityOfCancer); |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
91 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
92 std::map<std::string, ReferencedInstance> instancesInformation_; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
93 std::vector<std::string> orderedInstances_; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
94 std::list<Structure*> structures_; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
95 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
96 public: |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
97 DicomStructuredReport(Orthanc::ParsedDicomFile& dicom); |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
98 |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
99 ~DicomStructuredReport(); |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
100 }; |
554bc96e7508
added DicomStructuredReport
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
101 } |