annotate OrthancStone/Sources/Volumes/ImageBuffer3D.h @ 1512:244ad1e4e76a

reorganization of folders
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 07 Jul 2020 16:21:02 +0200
parents Framework/Volumes/ImageBuffer3D.h@7f16987131e1
children e731e62692a9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
1270
2d8ab34c8c91 upgrade to year 2020
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 765
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
10 * the License, or (at your option) any later version.
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
15 * Affero General Public License for more details.
318
3a4ca166fafa ImageAccessor refactoring + implemented Image Cache in SmartLoader
am@osimis.io
parents: 212
diff changeset
16 *
47
28956ed68280 agpl license
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 40
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
19 **/
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22 #pragma once
351ab0da0150 initial commit
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: 192
diff changeset
24 #include "../StoneEnumerations.h"
735
c3bbb130abc4 removing dependencies in ImageBuffer3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 734
diff changeset
25 #include "../Toolbox/LinearAlgebra.h"
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1298
diff changeset
27 #include <Compatibility.h>
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1298
diff changeset
28 #include <Images/Image.h>
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 namespace OrthancStone
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 {
1488
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
32 /*
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
33
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
34 This classes stores volume images sliced across the Z axis, vertically, in the decreasing Z order :
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
35
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
36 +---------------+
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
37 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
38 | SLICE N-1 |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
39 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
40 +---------------+
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
41 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
42 | SLICE N-2 |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
43 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
44 +---------------+
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
45 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
46 | SLICE N-3 |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
47 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
48 . .
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
49 ...... ......
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
50 . .
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
51 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
52 | SLICE 2 |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
53 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
54 +---------------+
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
55 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
56 | SLICE 1 |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
57 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
58 +---------------+
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
59 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
60 | SLICE 0 |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
61 | |
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
62 +---------------+
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
63
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
64 As you can see, if the 3d image has size width, height, depth, the 2d image has :
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
65 - 2d width = 3d width
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
66 - 2d height = 3d height * 3d depth
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
67
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
68 */
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
69
53
c2dc924f1a63 removing threading out of the framework
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 47
diff changeset
70 class ImageBuffer3D : public boost::noncopyable
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72 private:
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 Orthanc::Image image_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 Orthanc::PixelFormat format_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 unsigned int width_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 unsigned int height_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 unsigned int depth_;
119
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
78 bool computeRange_;
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
79 bool hasRange_;
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
80 float minValue_;
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
81 float maxValue_;
683
dbc1d8bfc68a reorganizing ImageBuffer3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 439
diff changeset
82 Matrix transform_;
dbc1d8bfc68a reorganizing ImageBuffer3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 439
diff changeset
83 Matrix transformInverse_;
dbc1d8bfc68a reorganizing ImageBuffer3D
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 439
diff changeset
84
119
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
85 void ExtendImageRange(const Orthanc::ImageAccessor& slice);
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86
316
ce48c3b3b0e9 fix for new ImageAccessor API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 212
diff changeset
87 void GetAxialSliceAccessor(Orthanc::ImageAccessor& target,
ce48c3b3b0e9 fix for new ImageAccessor API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 212
diff changeset
88 unsigned int slice,
ce48c3b3b0e9 fix for new ImageAccessor API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 212
diff changeset
89 bool readOnly) const;
ce48c3b3b0e9 fix for new ImageAccessor API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 212
diff changeset
90
ce48c3b3b0e9 fix for new ImageAccessor API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 212
diff changeset
91 void GetCoronalSliceAccessor(Orthanc::ImageAccessor& target,
ce48c3b3b0e9 fix for new ImageAccessor API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 212
diff changeset
92 unsigned int slice,
ce48c3b3b0e9 fix for new ImageAccessor API
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 212
diff changeset
93 bool readOnly) const;
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
95 Orthanc::Image* ExtractSagittalSlice(unsigned int slice) const;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
96
143
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
97 template <typename T>
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
98 T GetPixelUnchecked(unsigned int x,
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
99 unsigned int y,
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
100 unsigned int z) const
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
101 {
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
102 const uint8_t* buffer = reinterpret_cast<const uint8_t*>(image_.GetConstBuffer());
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
103 const uint8_t* row = buffer + (y + height_ * (depth_ - 1 - z)) * image_.GetPitch();
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
104 return reinterpret_cast<const T*>(row) [x];
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
105 }
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
106
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
107 public:
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
108 ImageBuffer3D(Orthanc::PixelFormat format,
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
109 unsigned int width,
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
110 unsigned int height,
119
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
111 unsigned int depth,
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
112 bool computeRange);
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
113
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 void Clear();
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115
179
db21c1810c89 moving PixelTraits to the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
116 const Orthanc::ImageAccessor& GetInternalImage() const
db21c1810c89 moving PixelTraits to the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
117 {
db21c1810c89 moving PixelTraits to the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
118 return image_;
db21c1810c89 moving PixelTraits to the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
119 }
db21c1810c89 moving PixelTraits to the Orthanc core
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 149
diff changeset
120
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121 unsigned int GetWidth() const
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
122 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 return width_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126 unsigned int GetHeight() const
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 return height_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131 unsigned int GetDepth() const
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 return depth_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 Orthanc::PixelFormat GetFormat() const
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138 return format_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
139 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
140
765
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
141 unsigned int GetBytesPerPixel() const
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
142 {
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
143 return Orthanc::GetBytesPerPixel(format_);
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
144 }
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 735
diff changeset
145
105
e0ddd8cad909 cleaning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
146 uint64_t GetEstimatedMemorySize() const;
e0ddd8cad909 cleaning
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 87
diff changeset
147
119
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
148 bool GetRange(float& minValue,
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
149 float& maxValue) const;
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
150
143
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
151 uint8_t GetVoxelGrayscale8Unchecked(unsigned int x,
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
152 unsigned int y,
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
153 unsigned int z) const
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
154 {
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
155 return GetPixelUnchecked<uint8_t>(x, y, z);
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
156 }
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
157
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
158 uint16_t GetVoxelGrayscale16Unchecked(unsigned int x,
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
159 unsigned int y,
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
160 unsigned int z) const
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
161 {
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
162 return GetPixelUnchecked<uint16_t>(x, y, z);
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
163 }
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
164
149
f7be90de6d1b ImageBuffer3D::GetVoxelSignedGrayscale16Unchecked()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 143
diff changeset
165 int16_t GetVoxelSignedGrayscale16Unchecked(unsigned int x,
f7be90de6d1b ImageBuffer3D::GetVoxelSignedGrayscale16Unchecked()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 143
diff changeset
166 unsigned int y,
f7be90de6d1b ImageBuffer3D::GetVoxelSignedGrayscale16Unchecked()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 143
diff changeset
167 unsigned int z) const
f7be90de6d1b ImageBuffer3D::GetVoxelSignedGrayscale16Unchecked()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 143
diff changeset
168 {
f7be90de6d1b ImageBuffer3D::GetVoxelSignedGrayscale16Unchecked()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 143
diff changeset
169 return GetPixelUnchecked<int16_t>(x, y, z);
f7be90de6d1b ImageBuffer3D::GetVoxelSignedGrayscale16Unchecked()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 143
diff changeset
170 }
f7be90de6d1b ImageBuffer3D::GetVoxelSignedGrayscale16Unchecked()
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 143
diff changeset
171
143
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
172 uint8_t GetVoxelGrayscale8(unsigned int x,
141
88bca952cb17 ImageBuffer3D::GetPixelGrayscale8
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
173 unsigned int y,
88bca952cb17 ImageBuffer3D::GetPixelGrayscale8
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
174 unsigned int z) const;
88bca952cb17 ImageBuffer3D::GetPixelGrayscale8
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 139
diff changeset
175
143
58c545177c1c optimization
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 141
diff changeset
176 uint16_t GetVoxelGrayscale16(unsigned int x,
139
22628d37ef5c ImageBuffer3D::GetPixelGrayscale16
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
177 unsigned int y,
22628d37ef5c ImageBuffer3D::GetPixelGrayscale16
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
178 unsigned int z) const;
22628d37ef5c ImageBuffer3D::GetPixelGrayscale16
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 135
diff changeset
179
684
7719eb852dd5 new class: VolumeImageGeometry
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 683
diff changeset
180
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
181 class SliceReader : public boost::noncopyable
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
182 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
183 private:
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
184 Orthanc::ImageAccessor accessor_;
1298
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
185 std::unique_ptr<Orthanc::Image> sagittal_; // Unused for axial and coronal
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 public:
192
371da7fe2c0e FiniteProjectiveCamera::ApplyRaytracer
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 187
diff changeset
188 SliceReader(const ImageBuffer3D& that,
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 VolumeProjection projection,
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 unsigned int slice);
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192 const Orthanc::ImageAccessor& GetAccessor() const
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 return accessor_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196 };
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
197
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 class SliceWriter : public boost::noncopyable
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 private:
119
ba83e38cf3ff rendering of rt-dose
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 113
diff changeset
202 ImageBuffer3D& that_;
87
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 53
diff changeset
203 bool modified_;
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 Orthanc::ImageAccessor accessor_;
1298
8a0a62189f46 replacing std::auto_ptr by std::unique_ptr
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
205 std::unique_ptr<Orthanc::Image> sagittal_; // Unused for axial and coronal
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207 void Flush();
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 public:
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 SliceWriter(ImageBuffer3D& that,
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 VolumeProjection projection,
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 unsigned int slice);
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214 ~SliceWriter()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
215 {
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
216 Flush();
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
217 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218
87
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 53
diff changeset
219 const Orthanc::ImageAccessor& GetAccessor() const
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 53
diff changeset
220 {
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 53
diff changeset
221 return accessor_;
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 53
diff changeset
222 }
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 53
diff changeset
223
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 Orthanc::ImageAccessor& GetAccessor()
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 {
87
4a541cd4fa83 OrthancVolumeImageLoader
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 53
diff changeset
226 modified_ = true;
0
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 return accessor_;
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 }
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 };
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 };
351ab0da0150 initial commit
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 }