comparison OrthancStone/Sources/Toolbox/Internals/BucketMapper.h @ 1891:3716d72161d2

reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 19 Jan 2022 12:32:15 +0100
parents
children 07964689cb0b
comparison
equal deleted inserted replaced
1890:6ce81914f7e4 1891:3716d72161d2
1 /**
2 * Stone of Orthanc
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 * Copyright (C) 2017-2022 Osimis S.A., Belgium
6 * Copyright (C) 2021-2022 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 *
8 * This program is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU Lesser General Public License
10 * as published by the Free Software Foundation, either version 3 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Lesser General Public License for more details.
17 *
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with this program. If not, see
20 * <http://www.gnu.org/licenses/>.
21 **/
22
23
24 #pragma once
25
26 #include <boost/noncopyable.hpp>
27 #include <stddef.h>
28
29
30 namespace OrthancStone
31 {
32 namespace Internals
33 {
34 class BucketMapper : public boost::noncopyable
35 {
36 private:
37 double minValue_;
38 double maxValue_;
39 size_t bucketsCount_;
40
41 public:
42 BucketMapper(double minValue,
43 double maxValue,
44 size_t bucketsCount);
45
46 size_t GetSize() const
47 {
48 return bucketsCount_;
49 }
50
51 void CheckIndex(size_t i) const;
52
53 double GetBucketLow(size_t i) const;
54
55 double GetBucketHigh(size_t i) const;
56
57 double GetBucketCenter(size_t i) const;
58
59 size_t GetBucketIndex(double value) const;
60 };
61 }
62 }