ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkHilbertPath.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkHilbertPath_h
19#define itkHilbertPath_h
20
21#include "itkPath.h"
22
23#include "itkNumericTraits.h"
24
25namespace itk
26{
51template <typename TIndexValue = unsigned int, unsigned int VDimension = 3>
52class ITK_TEMPLATE_EXPORT HilbertPath : public Path<TIndexValue, Index<VDimension>, VDimension>
53{
54public:
55 ITK_DISALLOW_COPY_AND_MOVE(HilbertPath);
56
62
64 itkOverrideGetNameOfClassMacro(HilbertPath);
65
67 itkNewMacro(Self);
68
70 static constexpr unsigned int Dimension = VDimension;
71
73 using typename Superclass::OutputType;
74 using typename Superclass::InputType;
75
79 using HilbertOrderType = unsigned int;
80 using HilbertPathType = std::vector<IndexType>;
81 using HilbertPathSizeType = typename HilbertPathType::size_type;
82 using typename Superclass::OffsetType;
83
84 // Functions inherited from Path
85
88 Evaluate(const PathIndexType & input) const override
89 {
90 return this->m_HilbertPath[input];
91 }
92
93 OutputType
94 EvaluateToIndex(const PathIndexType & input) const override
95 {
96 return this->m_HilbertPath[input];
97 }
98
100 virtual InputType
102 {
104 }
105
107 InputType
108 EndOfInput() const override
109 {
110 return static_cast<InputType>(this->NumberOfSteps()); // 0 is before the first step, 1 is after it
111 }
112
116 OffsetType
117 IncrementInput(InputType & itkNotUsed(input)) const override
118 {
119 itkExceptionMacro("Not implemented.");
120 }
121
123 virtual inline void
125 {
126 this->m_HilbertPath.clear();
127 this->Modified();
128 }
129
130
132 virtual inline HilbertPathSizeType
134 {
135 return m_HilbertPath.size();
136 }
137
139 void
140 Initialize() override
141 {
142 this->Clear();
143 this->ConstructHilbertPath();
144 }
145
146
150 itkSetClampMacro(HilbertOrder, HilbertOrderType, 1, NumericTraits<HilbertOrderType>::max());
151 itkGetConstMacro(HilbertOrder, HilbertOrderType);
153
157
161
162protected:
164 ~HilbertPath() override = default;
165 void
166 PrintSelf(std::ostream & os, Indent indent) const override;
167
168private:
169 void
171
174
177
180
183
186
189
192
195
198
201
204
207};
208} // end namespace itk
209
210#ifndef ITK_MANUAL_INSTANTIATION
211# include "itkHilbertPath.hxx"
212#endif
213
214#endif
static constexpr unsigned int Dimension
HilbertPath< TIndexValue, VDimension > Self
virtual void Clear()
virtual HilbertPathSizeType NumberOfSteps() const
OutputType Evaluate(const PathIndexType &input) const override
PathIndexType SetBit(const PathIndexType, const PathIndexType, const PathIndexType, const PathIndexType)
Path< unsigned int, Index< VDimension >, VDimension > Superclass
PathIndexType GetLeftBitRotation(PathIndexType, PathIndexType, const PathIndexType)
typename HilbertPathType::size_type HilbertPathSizeType
PathIndexType GetGrayCode(const PathIndexType)
PathIndexType GetEntry(const PathIndexType)
void PrintSelf(std::ostream &os, Indent indent) const override
void Initialize() override
PathIndexType GetRightBitRotation(PathIndexType, PathIndexType, const PathIndexType)
PathIndexType GetInverseGrayCode(const PathIndexType)
PathIndexType GetTransform(const PathIndexType, const PathIndexType, const PathIndexType, const PathIndexType)
OutputType EvaluateToIndex(const PathIndexType &input) const override
virtual InputType EvaluateInverse(const IndexType &input)
PathIndexType GetDirection(const PathIndexType, const PathIndexType)
PathIndexType GetTrailingSetBits(const PathIndexType, const PathIndexType)
InputType EndOfInput() const override
IndexType TransformPathIndexToMultiDimensionalIndex(const PathIndexType id)
PathIndexType GetBitRange(const PathIndexType, const PathIndexType, const PathIndexType, const PathIndexType)
PathIndexType TransformMultiDimensionalIndexToPathIndex(const IndexType &index)
OffsetType IncrementInput(InputType &input) const override
~HilbertPath() override=default
PathIndexType GetInverseTransform(const PathIndexType, const PathIndexType, const PathIndexType, const PathIndexType)
Control indentation during Print() invocation.
Definition itkIndent.h:50
static constexpr T max(const T &)
virtual void Modified() const
Implements transparent reference counting.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....