ITK  6.0.0
Insight Toolkit
itkPath.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 itkPath_h
19#define itkPath_h
20
21#include "itkDataObject.h"
22#include "itkIndex.h"
23#include "itkNumericTraits.h"
24
25namespace itk
26{
53template <typename TInput, typename TOutput, unsigned int VDimension>
54class ITK_TEMPLATE_EXPORT Path : public DataObject
55{
56public:
57 ITK_DISALLOW_COPY_AND_MOVE(Path);
58
60 using Self = Path;
64
66 static constexpr unsigned int PathDimension = VDimension;
67
69 itkOverrideGetNameOfClassMacro(Path);
70
72 using InputType = TInput;
73
75 using OutputType = TOutput;
76
80
84 virtual inline InputType
86 {
87 return InputType{};
88 }
89
92 virtual inline InputType
93 EndOfInput() const
94 {
96 }
97
100 virtual OutputType
101 Evaluate(const InputType & input) const = 0;
102
104 virtual IndexType
105 EvaluateToIndex(const InputType & input) const = 0;
106
115 virtual OffsetType
116 IncrementInput(InputType & input) const = 0;
117
118protected:
120 ~Path() override = default;
121
122 void
123 PrintSelf(std::ostream & os, Indent indent) const override;
124
125 itkGetConstMacro(ZeroOffset, OffsetType);
126 itkGetConstMacro(ZeroIndex, IndexType);
127
128private:
129 // These "constants" are initialized in the constructor
130 OffsetType m_ZeroOffset{}; // = 0 for all dimensions
131 IndexType m_ZeroIndex{}; // = 0 for all dimensions
132};
133} // namespace itk
134
135#ifndef ITK_MANUAL_INSTANTIATION
136# include "itkPath.hxx"
137#endif
138
139#endif
Base class for all data objects in ITK.
Control indentation during Print() invocation.
Definition: itkIndent.h:50
Base class for most ITK classes.
Definition: itkObject.h:62
Represent a path through ND Space.
Definition: itkPath.h:55
virtual OffsetType IncrementInput(InputType &input) const =0
virtual IndexType EvaluateToIndex(const InputType &input) const =0
TInput InputType
Definition: itkPath.h:72
~Path() override=default
virtual InputType StartOfInput() const
Definition: itkPath.h:85
virtual OutputType Evaluate(const InputType &input) const =0
void PrintSelf(std::ostream &os, Indent indent) const override
TOutput OutputType
Definition: itkPath.h:75
virtual InputType EndOfInput() const
Definition: itkPath.h:93
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
class ITK_FORWARD_EXPORT DataObject
Definition: itkDataObject.h:42