Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/StoneEnumerations.cpp @ 2101:517ef20aef74
sync
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 14 Nov 2023 11:44:46 +0100 |
parents | 7c3d65166c26 |
children | c23eef785569 |
rev | line source |
---|---|
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
1 /** |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
2 * Stone of Orthanc |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
4 * Department, University Hospital of Liege, Belgium |
2077
07964689cb0b
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1887
diff
changeset
|
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium |
07964689cb0b
upgrade to year 2023
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1887
diff
changeset
|
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
7 * |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
8 * This program is free software: you can redistribute it and/or |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
9 * modify it under the terms of the GNU Lesser General Public License |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
10 * as published by the Free Software Foundation, either version 3 of |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
11 * the License, or (at your option) any later version. |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
12 * |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
13 * This program is distributed in the hope that it will be useful, but |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
16 * Lesser General Public License for more details. |
1596
4fb8fdf03314
removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1512
diff
changeset
|
17 * |
1598
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
18 * You should have received a copy of the GNU Lesser General Public |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
19 * License along with this program. If not, see |
8563ea5d8ae4
relicensing some files, cf. osimis bm26 and chu agreement on 2020-05-20
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1596
diff
changeset
|
20 * <http://www.gnu.org/licenses/>. |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
21 **/ |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
22 |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
23 |
194
7a031ac16b2d
rename Enumerations.h to StoneEnumerations.h to avoid clashes with Orthanc
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
174
diff
changeset
|
24 #include "StoneEnumerations.h" |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
25 |
1455
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
26 #include <Logging.h> |
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
27 #include <OrthancException.h> |
30deba7bc8e2
simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1270
diff
changeset
|
28 #include <Toolbox.h> |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
29 |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
30 namespace OrthancStone |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
31 { |
625
2eeb5857eb43
DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
589
diff
changeset
|
32 SopClassUid StringToSopClassUid(const std::string& source) |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
33 { |
174
a7674c0ae4ac
fix captain rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
142
diff
changeset
|
34 std::string s = Orthanc::Toolbox::StripSpaces(source); |
a7674c0ae4ac
fix captain rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
142
diff
changeset
|
35 |
a7674c0ae4ac
fix captain rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
142
diff
changeset
|
36 if (s == "1.2.840.10008.5.1.4.1.1.481.2") |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
37 { |
625
2eeb5857eb43
DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
589
diff
changeset
|
38 return SopClassUid_RTDose; |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
39 } |
1665
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
40 else if (s == "1.2.840.10008.5.1.4.1.1.481.5") |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
41 { |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
42 return SopClassUid_RTPlan; |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
43 } |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
44 else if (s == "1.2.840.10008.5.1.4.1.1.481.3") |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
45 { |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
46 return SopClassUid_RTStruct; |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
47 } |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
48 else if (s == "1.2.840.10008.5.1.4.1.1.104.1") |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
49 { |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
50 return SopClassUid_EncapsulatedPdf; |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
51 } |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
52 else if (s == "1.2.840.10008.5.1.4.1.1.77.1.1.1") |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
53 { |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
54 return SopClassUid_VideoEndoscopicImageStorage; |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
55 } |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
56 else if (s == "1.2.840.10008.5.1.4.1.1.77.1.2.1") |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
57 { |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
58 return SopClassUid_VideoMicroscopicImageStorage; |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
59 } |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
60 else if (s == "1.2.840.10008.5.1.4.1.1.77.1.4.1") |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
61 { |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
62 return SopClassUid_VideoPhotographicImageStorage; |
1887
aa4ed1cf4e8d
refactoring using DataAugmentationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1871
diff
changeset
|
63 } |
aa4ed1cf4e8d
refactoring using DataAugmentationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1871
diff
changeset
|
64 else if (s == "1.2.840.10008.5.1.4.1.1.66.4") |
aa4ed1cf4e8d
refactoring using DataAugmentationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1871
diff
changeset
|
65 { |
aa4ed1cf4e8d
refactoring using DataAugmentationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1871
diff
changeset
|
66 return SopClassUid_DicomSeg; |
aa4ed1cf4e8d
refactoring using DataAugmentationParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1871
diff
changeset
|
67 } |
2094
7c3d65166c26
partial integration dicom-sr->mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
68 else if (s == "1.2.840.10008.5.1.4.1.1.88.33") |
7c3d65166c26
partial integration dicom-sr->mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
69 { |
7c3d65166c26
partial integration dicom-sr->mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
70 return SopClassUid_ComprehensiveSR; |
7c3d65166c26
partial integration dicom-sr->mainline
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
71 } |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
72 else |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
73 { |
625
2eeb5857eb43
DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
589
diff
changeset
|
74 //LOG(INFO) << "Other SOP class UID: " << source; |
2eeb5857eb43
DicomInstanceParameters
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
589
diff
changeset
|
75 return SopClassUid_Other; |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
76 } |
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
77 } |
142
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
78 |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
79 |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
80 void ComputeWindowing(float& targetCenter, |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
81 float& targetWidth, |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
82 ImageWindowing windowing, |
589
3080ec4ec6b9
removed enum value: ImageWindowing_Default
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
559
diff
changeset
|
83 float customCenter, |
3080ec4ec6b9
removed enum value: ImageWindowing_Default
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
559
diff
changeset
|
84 float customWidth) |
142
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
85 { |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
86 switch (windowing) |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
87 { |
589
3080ec4ec6b9
removed enum value: ImageWindowing_Default
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
559
diff
changeset
|
88 case ImageWindowing_Custom: |
3080ec4ec6b9
removed enum value: ImageWindowing_Default
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
559
diff
changeset
|
89 targetCenter = customCenter; |
3080ec4ec6b9
removed enum value: ImageWindowing_Default
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
559
diff
changeset
|
90 targetWidth = customWidth; |
142
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
91 break; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
92 |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
93 case ImageWindowing_Bone: |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
94 targetCenter = 300; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
95 targetWidth = 2000; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
96 break; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
97 |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
98 case ImageWindowing_Lung: |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
99 targetCenter = -600; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
100 targetWidth = 1600; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
101 break; |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
102 |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
103 default: |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
104 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
105 } |
f19194a11c1d
ComputeWindowing in Enumerations.h
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
135
diff
changeset
|
106 } |
366
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
107 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
108 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
109 void ComputeAnchorTranslation(double& deltaX, |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
110 double& deltaY, |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
111 BitmapAnchor anchor, |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
112 unsigned int bitmapWidth, |
557
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
113 unsigned int bitmapHeight, |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
114 unsigned int border) |
366
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
115 { |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
116 double dw = static_cast<double>(bitmapWidth); |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
117 double dh = static_cast<double>(bitmapHeight); |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
118 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
119 switch (anchor) |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
120 { |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
121 case BitmapAnchor_TopLeft: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
122 deltaX = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
123 deltaY = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
124 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
125 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
126 case BitmapAnchor_TopCenter: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
127 deltaX = -dw / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
128 deltaY = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
129 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
130 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
131 case BitmapAnchor_TopRight: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
132 deltaX = -dw; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
133 deltaY = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
134 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
135 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
136 case BitmapAnchor_CenterLeft: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
137 deltaX = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
138 deltaY = -dh / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
139 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
140 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
141 case BitmapAnchor_Center: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
142 deltaX = -dw / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
143 deltaY = -dh / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
144 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
145 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
146 case BitmapAnchor_CenterRight: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
147 deltaX = -dw; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
148 deltaY = -dh / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
149 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
150 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
151 case BitmapAnchor_BottomLeft: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
152 deltaX = 0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
153 deltaY = -dh; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
154 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
155 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
156 case BitmapAnchor_BottomCenter: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
157 deltaX = -dw / 2.0; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
158 deltaY = -dh; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
159 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
160 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
161 case BitmapAnchor_BottomRight: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
162 deltaX = -dw; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
163 deltaY = -dh; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
164 break; |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
165 |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
166 default: |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
167 throw Orthanc::OrthancException(Orthanc::ErrorCode_ParameterOutOfRange); |
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
168 } |
557
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
169 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
170 if (border != 0) |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
171 { |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
172 double b = static_cast<double>(border); |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
173 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
174 switch (anchor) |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
175 { |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
176 case BitmapAnchor_TopLeft: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
177 case BitmapAnchor_TopCenter: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
178 case BitmapAnchor_TopRight: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
179 deltaY += b; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
180 break; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
181 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
182 case BitmapAnchor_BottomLeft: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
183 case BitmapAnchor_BottomCenter: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
184 case BitmapAnchor_BottomRight: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
185 deltaY -= b; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
186 break; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
187 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
188 default: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
189 break; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
190 } |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
191 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
192 switch (anchor) |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
193 { |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
194 case BitmapAnchor_TopLeft: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
195 case BitmapAnchor_CenterLeft: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
196 case BitmapAnchor_BottomLeft: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
197 deltaX += b; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
198 break; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
199 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
200 case BitmapAnchor_CenterRight: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
201 case BitmapAnchor_TopRight: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
202 case BitmapAnchor_BottomRight: |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
203 deltaX -= b; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
204 break; |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
205 |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
206 default: |
559 | 207 break; |
557
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
208 } |
77a21b28becd
new argument in ComputeAnchorTranslation: border
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
439
diff
changeset
|
209 } |
366
a7de01c8fd29
new enum BitmapAnchor
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
212
diff
changeset
|
210 } |
1665
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
211 |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
212 |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
213 SeriesThumbnailType GetSeriesThumbnailType(SopClassUid sopClassUid) |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
214 { |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
215 switch (sopClassUid) |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
216 { |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
217 case SopClassUid_EncapsulatedPdf: |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
218 return SeriesThumbnailType_Pdf; |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
219 |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
220 case SopClassUid_VideoEndoscopicImageStorage: |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
221 case SopClassUid_VideoMicroscopicImageStorage: |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
222 case SopClassUid_VideoPhotographicImageStorage: |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
223 return SeriesThumbnailType_Video; |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
224 |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
225 default: |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
226 return SeriesThumbnailType_Unsupported; |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
227 } |
f62f685e0eb2
avoid loading instance metadata on RTSTRUCT to avoid JSON parsing that freezes the browser
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
1598
diff
changeset
|
228 } |
117
42c05a3baee3
loading multi-frame instances as 3D volumes
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff
changeset
|
229 } |