annotate OrthancStone/Sources/Toolbox/SubvoxelReader.h @ 1644:4796fb60999e

removing methods from SortedFrames to simplify api
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 10 Nov 2020 18:08:16 +0100
parents 8563ea5d8ae4
children 9ac2a65d4172
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
1 /**
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
2 * Stone of Orthanc
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
98da3a8d4820 SubvoxelReader
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: 439
diff changeset
5 * Copyright (C) 2017-2020 Osimis S.A., Belgium
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
6 *
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
7 * 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
8 * modify it under the terms of the GNU Lesser General Public License
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
10 * the License, or (at your option) any later version.
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
11 *
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
13 * 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
14 * 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
15 * Lesser General Public License for more details.
1596
4fb8fdf03314 removed annoying whitespace
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1571
diff changeset
16 *
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
17 * 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
18 * 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
19 * <http://www.gnu.org/licenses/>.
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
20 **/
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
21
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
22
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
23 #pragma once
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
24
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
25 #include "../Volumes/ImageBuffer3D.h"
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
26 #include "GeometryToolbox.h"
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
27
1455
30deba7bc8e2 simplifying include_directories
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1270
diff changeset
28 #include <Images/ImageTraits.h>
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
29
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
30 #include <boost/noncopyable.hpp>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
31 #include <cmath>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
32
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
33 namespace OrthancStone
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
34 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
35 namespace Internals
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
36 {
1488
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 WARNING : the slice order is different between this class and ImageBuffer3D
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 See the comment above ImageBuffer3D declaration.
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 The slices are supposed to be stored in INCREASING z-order in this class!
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
43 */
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
44 class SubvoxelReaderBase : public boost::noncopyable
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
45 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
46 private:
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
47 const ImageBuffer3D& source_;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
48 unsigned int width_;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
49 unsigned int height_;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
50 unsigned int depth_;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
51
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
52 public:
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
53 explicit SubvoxelReaderBase(const ImageBuffer3D& source) :
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
54 source_(source),
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
55 width_(source.GetWidth()),
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
56 height_(source.GetHeight()),
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
57 depth_(source.GetDepth())
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
58 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
59 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
60
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
61 ORTHANC_FORCE_INLINE
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
62 const Orthanc::ImageAccessor& GetSource() const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
63 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
64 return source_.GetInternalImage();
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
65 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
66
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
67 ORTHANC_FORCE_INLINE
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
68 unsigned int GetWidth() const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
69 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
70 return width_;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
71 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
72
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
73 ORTHANC_FORCE_INLINE
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
74 unsigned int GetHeight() const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
75 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
76 return height_;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
77 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
78
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
79 ORTHANC_FORCE_INLINE
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
80 unsigned int GetDepth() const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
81 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
82 return depth_;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
83 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
84
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
85 ORTHANC_FORCE_INLINE
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
86 unsigned int ComputeRow(unsigned int y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
87 unsigned int z) const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
88 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
89 return z * height_ + y;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
90 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
91 };
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
92 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
93
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
94
1488
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
95 /*
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
96 WARNING : the slice order is different between this class and ImageBuffer3D
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
97
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
98 See the comment above ImageBuffer3D declaration.
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
99
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
100 The slices are supposed to be stored in INCREASING z-order in this class!
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
101 */
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
102 template <Orthanc::PixelFormat Format,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
103 ImageInterpolation Interpolation>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
104 class SubvoxelReader;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
105
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
106
1488
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
107 /*
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
108 WARNING : the slice order is different between this class and ImageBuffer3D
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
109
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
110 See the comment above ImageBuffer3D declaration.
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
111
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
112 The slices are supposed to be stored in INCREASING z-order in this class!
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
113 */
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
114 template <Orthanc::PixelFormat Format>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
115 class SubvoxelReader<Format, ImageInterpolation_Nearest> :
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
116 public Internals::SubvoxelReaderBase
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
117 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
118 public:
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
119 typedef Orthanc::PixelTraits<Format> Traits;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
120 typedef typename Traits::PixelType PixelType;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
121
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
122 explicit SubvoxelReader(const ImageBuffer3D& source) :
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
123 SubvoxelReaderBase(source)
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
124 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
125 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
126
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
127 inline bool GetValue(PixelType& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
128 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
129 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
130 float z) const;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
131
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
132 inline bool GetFloatValue(float& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
133 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
134 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
135 float z) const;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
136 };
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
137
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
138
1488
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
139 /*
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
140 WARNING : the slice order is different between this class and ImageBuffer3D
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
141
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
142 See the comment above ImageBuffer3D declaration.
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
143
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
144 The slices are supposed to be stored in INCREASING z-order in this class!
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
145 */
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
146 template <Orthanc::PixelFormat Format>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
147 class SubvoxelReader<Format, ImageInterpolation_Bilinear> :
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
148 public Internals::SubvoxelReaderBase
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
149 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
150 public:
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
151 typedef Orthanc::PixelTraits<Format> Traits;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
152 typedef typename Traits::PixelType PixelType;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
153
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
154 explicit SubvoxelReader(const ImageBuffer3D& source) :
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
155 SubvoxelReaderBase(source)
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
156 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
157 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
158
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
159 inline bool Sample(float& f00,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
160 float& f01,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
161 float& f10,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
162 float& f11,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
163 unsigned int ux,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
164 unsigned int uy,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
165 unsigned int uz) const;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
166
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
167 inline bool GetValue(PixelType& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
168 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
169 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
170 float z) const;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
171
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
172 inline bool GetFloatValue(float& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
173 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
174 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
175 float z) const;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
176 };
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
177
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
178
1488
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
179 /*
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
180 WARNING : the slice order is different between this class and ImageBuffer3D
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
181
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
182 See the comment above ImageBuffer3D declaration.
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
183
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
184 The slices are supposed to be stored in INCREASING z-order in this class!
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
185 */
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
186 template <Orthanc::PixelFormat Format>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
187 class SubvoxelReader<Format, ImageInterpolation_Trilinear> :
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
188 public Internals::SubvoxelReaderBase
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
189 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
190 private:
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
191 SubvoxelReader<Format, ImageInterpolation_Bilinear> bilinear_;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
192
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
193 public:
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
194 typedef Orthanc::PixelTraits<Format> Traits;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
195 typedef typename Traits::PixelType PixelType;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
196
1571
85e117739eca cppcheck
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 1512
diff changeset
197 explicit SubvoxelReader(const ImageBuffer3D& source) :
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
198 SubvoxelReaderBase(source),
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
199 bilinear_(source)
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
200 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
201 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
202
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
203 inline bool GetValue(PixelType& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
204 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
205 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
206 float z) const;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
207
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
208 inline bool GetFloatValue(float& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
209 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
210 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
211 float z) const;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
212 };
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
213
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
214
1488
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
215 /*
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
216 See important comment above
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
217 */
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
218
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
219 template <Orthanc::PixelFormat Format>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
220 bool SubvoxelReader<Format, ImageInterpolation_Nearest>::GetValue(PixelType& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
221 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
222 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
223 float z) const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
224 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
225 if (x < 0 ||
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
226 y < 0 ||
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
227 z < 0)
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
228 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
229 return false;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
230 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
231 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
232 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
233 unsigned int ux = static_cast<unsigned int>(std::floor(x));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
234 unsigned int uy = static_cast<unsigned int>(std::floor(y));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
235 unsigned int uz = static_cast<unsigned int>(std::floor(z));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
236
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
237 if (ux < GetWidth() &&
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
238 uy < GetHeight() &&
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
239 uz < GetDepth())
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
240 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
241 Orthanc::ImageTraits<Format>::GetPixel(target, GetSource(), ux, ComputeRow(uy, uz));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
242 return true;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
243 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
244 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
245 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
246 return false;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
247 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
248 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
249 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
250
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
251
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
252 template <Orthanc::PixelFormat Format>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
253 bool SubvoxelReader<Format, ImageInterpolation_Nearest>::GetFloatValue(float& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
254 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
255 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
256 float z) const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
257 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
258 PixelType value;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
259
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
260 if (GetValue(value, x, y, z))
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
261 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
262 target = Traits::PixelToFloat(value);
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
263 return true;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
264 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
265 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
266 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
267 return false;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
268 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
269 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
270
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
271
1488
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
272 /*
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
273 See important comment above
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
274 */
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
275
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
276 template <Orthanc::PixelFormat Format>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
277 bool SubvoxelReader<Format, ImageInterpolation_Bilinear>::Sample(float& f00,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
278 float& f01,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
279 float& f10,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
280 float& f11,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
281 unsigned int ux,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
282 unsigned int uy,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
283 unsigned int uz) const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
284 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
285 if (ux < GetWidth() &&
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
286 uy < GetHeight() &&
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
287 uz < GetDepth())
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
288 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
289 f00 = Orthanc::ImageTraits<Format>::GetFloatPixel(GetSource(), ux, ComputeRow(uy, uz));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
290 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
291 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
292 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
293 // Pixel is out of the volume
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
294 return false;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
295 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
296
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
297 if (ux + 1 < GetWidth())
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
298 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
299 f01 = Orthanc::ImageTraits<Format>::GetFloatPixel(GetSource(), ux + 1, ComputeRow(uy, uz));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
300 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
301 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
302 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
303 f01 = f00;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
304 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
305
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
306 if (uy + 1 < GetHeight())
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
307 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
308 f10 = Orthanc::ImageTraits<Format>::GetFloatPixel(GetSource(), ux, ComputeRow(uy + 1, uz));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
309 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
310 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
311 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
312 f10 = f00;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
313 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
314
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
315 if (ux + 1 < GetWidth() &&
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
316 uy + 1 < GetHeight())
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
317 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
318 f11 = Orthanc::ImageTraits<Format>::GetFloatPixel(GetSource(), ux + 1, ComputeRow(uy + 1, uz));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
319 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
320 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
321 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
322 f11 = f00;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
323 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
324
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
325 return true;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
326 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
327
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
328
1488
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
329 /*
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
330 See important comment above
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
331 */
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
332
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
333 template <Orthanc::PixelFormat Format>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
334 bool SubvoxelReader<Format, ImageInterpolation_Bilinear>::GetFloatValue(float& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
335 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
336 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
337 float z) const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
338 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
339 x -= 0.5f;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
340 y -= 0.5f;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
341
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
342 if (x < 0 ||
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
343 y < 0 ||
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
344 z < 0)
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
345 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
346 return false;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
347 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
348 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
349 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
350 unsigned int ux = static_cast<unsigned int>(std::floor(x));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
351 unsigned int uy = static_cast<unsigned int>(std::floor(y));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
352 unsigned int uz = static_cast<unsigned int>(std::floor(z));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
353
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
354 float f00, f01, f10, f11;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
355 if (Sample(f00, f01, f10, f11, ux, uy, uz))
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
356 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
357 float ax = x - static_cast<float>(ux);
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
358 float ay = y - static_cast<float>(uy);
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
359
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
360 target = GeometryToolbox::ComputeBilinearInterpolationUnitSquare(ax, ay, f00, f01, f10, f11);
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
361 return true;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
362 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
363 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
364 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
365 return false;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
366 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
367 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
368 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
369
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
370
1488
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
371 /*
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
372 See important comment above
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
373 */
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
374
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
375 template <Orthanc::PixelFormat Format>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
376 bool SubvoxelReader<Format, ImageInterpolation_Bilinear>::GetValue(PixelType& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
377 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
378 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
379 float z) const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
380 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
381 float value;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
382
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
383 if (GetFloatValue(value, x, y, z))
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
384 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
385 Traits::FloatToPixel(target, value);
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
386 return true;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
387 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
388 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
389 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
390 return false;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
391 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
392 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
393
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
394
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
395
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
396 template <Orthanc::PixelFormat Format>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
397 bool SubvoxelReader<Format, ImageInterpolation_Trilinear>::GetFloatValue(float& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
398 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
399 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
400 float z) const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
401 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
402 x -= 0.5f;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
403 y -= 0.5f;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
404 z -= 0.5f;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
405
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
406 if (x < 0 ||
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
407 y < 0 ||
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
408 z < 0)
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
409 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
410 return false;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
411 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
412 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
413 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
414 unsigned int ux = static_cast<unsigned int>(std::floor(x));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
415 unsigned int uy = static_cast<unsigned int>(std::floor(y));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
416 unsigned int uz = static_cast<unsigned int>(std::floor(z));
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
417
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
418 float f000, f001, f010, f011;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
419 if (bilinear_.Sample(f000, f001, f010, f011, ux, uy, uz))
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
420 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
421 const float ax = x - static_cast<float>(ux);
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
422 const float ay = y - static_cast<float>(uy);
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
423
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
424 float f100, f101, f110, f111;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
425
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
426 if (bilinear_.Sample(f100, f101, f110, f111, ux, uy, uz + 1))
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
427 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
428 const float az = z - static_cast<float>(uz);
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
429 target = GeometryToolbox::ComputeTrilinearInterpolationUnitSquare
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
430 (ax, ay, az, f000, f001, f010, f011, f100, f101, f110, f111);
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
431 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
432 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
433 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
434 target = GeometryToolbox::ComputeBilinearInterpolationUnitSquare
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
435 (ax, ay, f000, f001, f010, f011);
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
436 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
437
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
438 return true;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
439 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
440 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
441 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
442 return false;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
443 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
444 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
445 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
446
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
447
1488
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
448 /*
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
449 See important comment above
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
450 */
7f16987131e1 Missing include + docs + public getter for volume geometry in multiframe loader
Benjamin Golinvaux <bgo@osimis.io>
parents: 1455
diff changeset
451
183
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
452
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
453 template <Orthanc::PixelFormat Format>
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
454 bool SubvoxelReader<Format, ImageInterpolation_Trilinear>::GetValue(PixelType& target,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
455 float x,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
456 float y,
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
457 float z) const
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
458 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
459 float value;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
460
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
461 if (GetFloatValue(value, x, y, z))
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
462 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
463 Traits::FloatToPixel(target, value);
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
464 return true;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
465 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
466 else
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
467 {
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
468 return false;
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
469 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
470 }
98da3a8d4820 SubvoxelReader
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
diff changeset
471 }