Mercurial > hg > orthanc-stone
annotate OrthancStone/Sources/Toolbox/Internals/BucketMapper.h @ 2123:538c7b7c6e46 deep-learning
integration mainline->deep-learning
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 22 Mar 2024 16:11:42 +0100 |
parents | c23eef785569 |
children | 16c01cc201e7 |
rev | line source |
---|---|
1891 | 1 /** |
2 * Stone of Orthanc | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
2114
c23eef785569
update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
5 * Copyright (C) 2017-2024 Osimis S.A., Belgium |
c23eef785569
update year to 2024
Sebastien Jodogne <s.jodogne@gmail.com>
parents:
2077
diff
changeset
|
6 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium |
1891 | 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 } |